lyda / chkcrontab

A tool for checking system crontab files (/etc/crontab and /etc/cron.d normally) for errors and common mistakes.
Other
59 stars 22 forks source link

RPM spec file #13

Open lyda opened 7 years ago

lyda commented 7 years ago

This was the other remaining issue from code.google: want an rpm spec file.

It's been a long time since I've made an rpm spec file but I can give it a go. Should be easy enough to get a fedora docker image. I'll see what other python projects do for packaging files.

lyda commented 7 years ago

Not required it appears. According to the dist module docs you can just do this to build an rpm:

./setup.py bdist --formats=rpm

Testing it now. This seems to provide a similar answer for Debian systems.

lyda commented 7 years ago

Nope, has a failure. Not sure why the doc/chkcrontab.1 file isn't following things around...

[root@5e451715dfcc data]# ./setup.py bdist --formats=rpm
running bdist
running bdist_rpm
writing 'build/bdist.linux-x86_64/rpm/SPECS/chkcrontab.spec'
running sdist
running check
warning: sdist: standard file not found: should have one of README, README.txt

reading manifest template 'MANIFEST.in'
warning: no files found matching 'OWNERS'
writing manifest file 'MANIFEST'
creating chkcrontab-v1.8-rc1-dirty
creating chkcrontab-v1.8-rc1-dirty/tests
creating chkcrontab-v1.8-rc1-dirty/tests/__pycache__
making hard links in chkcrontab-v1.8-rc1-dirty...
hard linking LICENSE -> chkcrontab-v1.8-rc1-dirty
hard linking README.rst -> chkcrontab-v1.8-rc1-dirty
hard linking _version.py -> chkcrontab-v1.8-rc1-dirty
hard linking chkcrontab -> chkcrontab-v1.8-rc1-dirty
hard linking chkcrontab_lib.py -> chkcrontab-v1.8-rc1-dirty
hard linking setup.py -> chkcrontab-v1.8-rc1-dirty
hard linking tests/cq.sh -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/test_check.py -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/test_check.pyc -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/test_crontab -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/test_crontab.disable -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/test_crontab.lookup -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/test_crontab.no-warn -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/test_crontab.warn -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/test_crontab.whitelist -> chkcrontab-v1.8-rc1-dirty/tests
hard linking tests/__pycache__/test_check.cpython-27-PYTEST.pyc -> chkcrontab-v1.8-rc1-dirty/tests/__pycache__
Creating tar archive
removing 'chkcrontab-v1.8-rc1-dirty' (and everything under it)
copying dist/chkcrontab-v1.8-rc1-dirty.tar.gz -> build/bdist.linux-x86_64/rpm/SOURCES
building RPMs
rpmbuild -ba --define _topdir /data/build/bdist.linux-x86_64/rpm --clean build/bdist.linux-x86_64/rpm/SPECS/chkcrontab.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ykskhY
+ umask 022
+ cd /data/build/bdist.linux-x86_64/rpm/BUILD
+ cd /data/build/bdist.linux-x86_64/rpm/BUILD
+ rm -rf chkcrontab-v1.8-rc1-dirty
+ /usr/bin/gzip -dc /data/build/bdist.linux-x86_64/rpm/SOURCES/chkcrontab-v1.8-rc1-dirty.tar.gz
+ /usr/bin/tar -xvvof -
drwxr-xr-x root/root         0 2017-01-04 20:36 chkcrontab-v1.8-rc1-dirty/
-rw-r--r-- root/root        31 2017-01-04 20:36 chkcrontab-v1.8-rc1-dirty/_version.py
-rwxr-xr-x root/root      1988 2017-01-04 18:55 chkcrontab-v1.8-rc1-dirty/chkcrontab
-rwxr-xr-x root/root     36683 2017-01-04 18:55 chkcrontab-v1.8-rc1-dirty/chkcrontab_lib.py
-rw-r--r-- root/root     11376 2017-01-02 18:16 chkcrontab-v1.8-rc1-dirty/LICENSE
-rw-r--r-- root/root      4508 2017-01-04 20:36 chkcrontab-v1.8-rc1-dirty/PKG-INFO
-rw-r--r-- root/root      3126 2017-01-04 19:25 chkcrontab-v1.8-rc1-dirty/README.rst
-rwxr-xr-x root/root      5867 2017-01-04 20:22 chkcrontab-v1.8-rc1-dirty/setup.py
drwxr-xr-x root/root         0 2017-01-04 20:36 chkcrontab-v1.8-rc1-dirty/tests/
drwxr-xr-x root/root         0 2017-01-04 20:36 chkcrontab-v1.8-rc1-dirty/tests/__pycache__/
-rw-r--r-- root/root     12863 2017-01-02 20:08 chkcrontab-v1.8-rc1-dirty/tests/__pycache__/test_check.cpython-27-PYTEST.pyc
-rwxr-xr-x root/root       293 2017-01-02 18:16 chkcrontab-v1.8-rc1-dirty/tests/cq.sh
-rwxr-xr-x root/root     13180 2017-01-04 18:55 chkcrontab-v1.8-rc1-dirty/tests/test_check.py
-rw-r--r-- root/root     13497 2017-01-04 18:58 chkcrontab-v1.8-rc1-dirty/tests/test_check.pyc
-rw-r--r-- root/root      2145 2017-01-02 18:16 chkcrontab-v1.8-rc1-dirty/tests/test_crontab
-rw-r--r-- root/root      3021 2017-01-04 18:55 chkcrontab-v1.8-rc1-dirty/tests/test_crontab.disable
-rw-r--r-- root/root        86 2017-01-04 18:55 chkcrontab-v1.8-rc1-dirty/tests/test_crontab.lookup
-rw-r--r-- root/root       684 2017-01-02 18:16 chkcrontab-v1.8-rc1-dirty/tests/test_crontab.no-warn
-rw-r--r-- root/root       402 2017-01-02 18:16 chkcrontab-v1.8-rc1-dirty/tests/test_crontab.warn
-rw-r--r-- root/root       178 2017-01-03 21:55 chkcrontab-v1.8-rc1-dirty/tests/test_crontab.whitelist
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd chkcrontab-v1.8-rc1-dirty
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.8yxTTR
+ umask 022
+ cd /data/build/bdist.linux-x86_64/rpm/BUILD
+ cd chkcrontab-v1.8-rc1-dirty
+ python setup.py build
running build
running build_py
creating build
creating build/lib
copying chkcrontab_lib.py -> build/lib
copying _version.py -> build/lib
running build_scripts
creating build/scripts-2.7
copying and adjusting chkcrontab -> build/scripts-2.7
changing mode of build/scripts-2.7/chkcrontab from 644 to 755
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.RBHpuM
+ umask 022
+ cd /data/build/bdist.linux-x86_64/rpm/BUILD
+ '[' /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64 '!=' / ']'
+ rm -rf /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64
++ dirname /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64
+ mkdir -p /data/build/bdist.linux-x86_64/rpm/BUILDROOT
+ mkdir /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64
+ cd chkcrontab-v1.8-rc1-dirty
+ python setup.py install -O1 --root=/data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64 --record=INSTALLED_FILES
running install
running build
running build_py
running build_scripts
running install_lib
creating /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr
creating /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/lib
creating /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/lib/python2.7
creating /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/lib/python2.7/site-packages
copying build/lib/_version.py -> /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/lib/python2.7/site-packages
copying build/lib/chkcrontab_lib.py -> /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/lib/python2.7/site-packages
byte-compiling /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/lib/python2.7/site-packages/_version.py to _version.pyc
byte-compiling /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/lib/python2.7/site-packages/chkcrontab_lib.py to chkcrontab_lib.pyc
writing byte-compilation script '/tmp/tmpGEijc0.py'
/usr/bin/python -O /tmp/tmpGEijc0.py
removing /tmp/tmpGEijc0.py
running install_scripts
creating /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/bin
copying build/scripts-2.7/chkcrontab -> /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/bin
changing mode of /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/bin/chkcrontab to 755
running install_egg_info
Writing /data/build/bdist.linux-x86_64/rpm/BUILDROOT/chkcrontab-v1.8_rc1_dirty-1.x86_64/usr/lib/python2.7/site-packages/chkcrontab-v1.8_rc1_dirty-py2.7.egg-info
writing list of installed files to 'INSTALLED_FILES'
error: can't copy 'doc/chkcrontab.1': doesn't exist or not a regular file
error: Bad exit status from /var/tmp/rpm-tmp.RBHpuM (%install)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.RBHpuM (%install)
error: command 'rpmbuild' failed with exit status 1