diff options
Diffstat (limited to 'python-a2svm.spec')
-rw-r--r-- | python-a2svm.spec | 508 |
1 files changed, 508 insertions, 0 deletions
diff --git a/python-a2svm.spec b/python-a2svm.spec new file mode 100644 index 0000000..200ae21 --- /dev/null +++ b/python-a2svm.spec @@ -0,0 +1,508 @@ +%global _empty_manifest_terminate_build 0 +Name: python-a2svm +Version: 0.1.5 +Release: 1 +Summary: Simple CLI tool to create and delete easily virtual hosts in Apache. +License: GPL +URL: https://github.com/cypx/a2svm +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a6/41/55848c279e7fa701a769c1cd546e5ef05e6222f82a2f415e0740fc4f8a89/a2svm-0.1.5.tar.gz +BuildArch: noarch + +Requires: python3-appdirs +Requires: python3-argparse +Requires: python3-configparser +Requires: python3-future + +%description +********************************************** +A2SVM - Apache 2 Simple Virtualhost Manager +********************************************** + +**a2svm** is a Simple CLI tool to create and delete easily virtualhosts in Apache. + +usage: a2svm [-h] [-v] {mk,ls,rm,en,ds} ... + +a2svm commands are: + +* **mk** Create a virtualhosts +* **ls** Show managed virtualhosts on Apache server +* **rm** Delete a virtualhosts +* **en** Enable a virtualhosts +* **ds** Disable a virtualhosts + +See 'a2svm <command> -h' for more information on a specific command. + +PyPI package `<http://pypi.python.org/pypi/a2svm>`__ + +Sources `<https://github.com/cypx/a2svm>`__ + +Requirements +############## + +a2svm need apache mod_macro which could be installed on debian 6 by the following command + +.. code-block:: bash + + $ aptitude install libapache2-mod-macro + +Once mod_macro is avalaible some template could be created for use by a2svm like this one + +.. code-block:: xml + + <Macro vhost_standard $name $servername $directory> + <VirtualHost *:80> + + ServerName $servername + + DocumentRoot /var/www/$directory/public + + <Directory /var/www/$directory> + Options FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + allow from all + </Directory> + + ErrorLog ${APACHE_LOG_DIR}/error-$name.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/access-$name.log combined + </VirtualHost> + </Macro> + + #Comments beginning by "a2svm_make_command" are used to run external commands + #when vhost is created + #a2svm_make_command: /bin/mkdir -p /var/www/$directory/public /var/www/$directory/log + #a2svm_make_command: /bin/chown -R cyp:www-data /var/www/$directory + #Comments beginning by "a2svm_remove_command" are used to run external commands + #when vhost is removed + #a2svm_remove_command: /bin/tar czf /var/www/archive/$servername.tgz /var/www/$directory + #a2svm_remove_command: /bin/rm -rf /var/www/$directory + + + +Installation +############## + +Install it easily: + +Using pip +************** + +.. code-block:: bash + + $ pip install a2svm + +Warning! On some old distribution using Python 2.x, you could require to upgrade pip to support install, run: + +.. code-block:: bash + + $ pip install --index-url=https://pypi.python.org/simple/ --upgrade pip setuptools + +Using easy_install +********************* + +On most Linux distribution + +.. code-block:: bash + + $ easy_install a2svm + +But on some, prerequisites are required, for example, on Debian 6 + +.. code-block:: bash + + $ aptitude install python-pip + + +Upgrade +########## + +Using pip +************** + +.. code-block:: bash + + $ pip --upgrade a2svm + +Using easy_install +********************* + +.. code-block:: bash + + $ easy_install --upgrade a2svm + +From sources +*************** + +.. code-block:: bash + + $ git clone https://github.com/cypx/a2svm + $ cd a2svm + $ pip install -r requirements.txt + $ python setup.py install + +Reminder +*************** + +To publish package on pypi + +.. code-block:: bash + + $ pip install twine + $ rm -rf dist + $ python setup.py sdist bdist_wheel + $ twine upload dist/* + + + + +%package -n python3-a2svm +Summary: Simple CLI tool to create and delete easily virtual hosts in Apache. +Provides: python-a2svm +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-a2svm +********************************************** +A2SVM - Apache 2 Simple Virtualhost Manager +********************************************** + +**a2svm** is a Simple CLI tool to create and delete easily virtualhosts in Apache. + +usage: a2svm [-h] [-v] {mk,ls,rm,en,ds} ... + +a2svm commands are: + +* **mk** Create a virtualhosts +* **ls** Show managed virtualhosts on Apache server +* **rm** Delete a virtualhosts +* **en** Enable a virtualhosts +* **ds** Disable a virtualhosts + +See 'a2svm <command> -h' for more information on a specific command. + +PyPI package `<http://pypi.python.org/pypi/a2svm>`__ + +Sources `<https://github.com/cypx/a2svm>`__ + +Requirements +############## + +a2svm need apache mod_macro which could be installed on debian 6 by the following command + +.. code-block:: bash + + $ aptitude install libapache2-mod-macro + +Once mod_macro is avalaible some template could be created for use by a2svm like this one + +.. code-block:: xml + + <Macro vhost_standard $name $servername $directory> + <VirtualHost *:80> + + ServerName $servername + + DocumentRoot /var/www/$directory/public + + <Directory /var/www/$directory> + Options FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + allow from all + </Directory> + + ErrorLog ${APACHE_LOG_DIR}/error-$name.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/access-$name.log combined + </VirtualHost> + </Macro> + + #Comments beginning by "a2svm_make_command" are used to run external commands + #when vhost is created + #a2svm_make_command: /bin/mkdir -p /var/www/$directory/public /var/www/$directory/log + #a2svm_make_command: /bin/chown -R cyp:www-data /var/www/$directory + #Comments beginning by "a2svm_remove_command" are used to run external commands + #when vhost is removed + #a2svm_remove_command: /bin/tar czf /var/www/archive/$servername.tgz /var/www/$directory + #a2svm_remove_command: /bin/rm -rf /var/www/$directory + + + +Installation +############## + +Install it easily: + +Using pip +************** + +.. code-block:: bash + + $ pip install a2svm + +Warning! On some old distribution using Python 2.x, you could require to upgrade pip to support install, run: + +.. code-block:: bash + + $ pip install --index-url=https://pypi.python.org/simple/ --upgrade pip setuptools + +Using easy_install +********************* + +On most Linux distribution + +.. code-block:: bash + + $ easy_install a2svm + +But on some, prerequisites are required, for example, on Debian 6 + +.. code-block:: bash + + $ aptitude install python-pip + + +Upgrade +########## + +Using pip +************** + +.. code-block:: bash + + $ pip --upgrade a2svm + +Using easy_install +********************* + +.. code-block:: bash + + $ easy_install --upgrade a2svm + +From sources +*************** + +.. code-block:: bash + + $ git clone https://github.com/cypx/a2svm + $ cd a2svm + $ pip install -r requirements.txt + $ python setup.py install + +Reminder +*************** + +To publish package on pypi + +.. code-block:: bash + + $ pip install twine + $ rm -rf dist + $ python setup.py sdist bdist_wheel + $ twine upload dist/* + + + + +%package help +Summary: Development documents and examples for a2svm +Provides: python3-a2svm-doc +%description help +********************************************** +A2SVM - Apache 2 Simple Virtualhost Manager +********************************************** + +**a2svm** is a Simple CLI tool to create and delete easily virtualhosts in Apache. + +usage: a2svm [-h] [-v] {mk,ls,rm,en,ds} ... + +a2svm commands are: + +* **mk** Create a virtualhosts +* **ls** Show managed virtualhosts on Apache server +* **rm** Delete a virtualhosts +* **en** Enable a virtualhosts +* **ds** Disable a virtualhosts + +See 'a2svm <command> -h' for more information on a specific command. + +PyPI package `<http://pypi.python.org/pypi/a2svm>`__ + +Sources `<https://github.com/cypx/a2svm>`__ + +Requirements +############## + +a2svm need apache mod_macro which could be installed on debian 6 by the following command + +.. code-block:: bash + + $ aptitude install libapache2-mod-macro + +Once mod_macro is avalaible some template could be created for use by a2svm like this one + +.. code-block:: xml + + <Macro vhost_standard $name $servername $directory> + <VirtualHost *:80> + + ServerName $servername + + DocumentRoot /var/www/$directory/public + + <Directory /var/www/$directory> + Options FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + allow from all + </Directory> + + ErrorLog ${APACHE_LOG_DIR}/error-$name.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/access-$name.log combined + </VirtualHost> + </Macro> + + #Comments beginning by "a2svm_make_command" are used to run external commands + #when vhost is created + #a2svm_make_command: /bin/mkdir -p /var/www/$directory/public /var/www/$directory/log + #a2svm_make_command: /bin/chown -R cyp:www-data /var/www/$directory + #Comments beginning by "a2svm_remove_command" are used to run external commands + #when vhost is removed + #a2svm_remove_command: /bin/tar czf /var/www/archive/$servername.tgz /var/www/$directory + #a2svm_remove_command: /bin/rm -rf /var/www/$directory + + + +Installation +############## + +Install it easily: + +Using pip +************** + +.. code-block:: bash + + $ pip install a2svm + +Warning! On some old distribution using Python 2.x, you could require to upgrade pip to support install, run: + +.. code-block:: bash + + $ pip install --index-url=https://pypi.python.org/simple/ --upgrade pip setuptools + +Using easy_install +********************* + +On most Linux distribution + +.. code-block:: bash + + $ easy_install a2svm + +But on some, prerequisites are required, for example, on Debian 6 + +.. code-block:: bash + + $ aptitude install python-pip + + +Upgrade +########## + +Using pip +************** + +.. code-block:: bash + + $ pip --upgrade a2svm + +Using easy_install +********************* + +.. code-block:: bash + + $ easy_install --upgrade a2svm + +From sources +*************** + +.. code-block:: bash + + $ git clone https://github.com/cypx/a2svm + $ cd a2svm + $ pip install -r requirements.txt + $ python setup.py install + +Reminder +*************** + +To publish package on pypi + +.. code-block:: bash + + $ pip install twine + $ rm -rf dist + $ python setup.py sdist bdist_wheel + $ twine upload dist/* + + + + +%prep +%autosetup -n a2svm-0.1.5 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-a2svm -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.5-1 +- Package Spec generated |