introduce spec file and related build scripts
The repository now contains a Vagrantfile for running the testing script against an RPM package created locally using `make rpm`. To run this test use `make vagrant-test`. setup.py was also modified to adhere to packaging guidelines and not to install system-level executables. The lincense is now included in the Python package using the MANIFEST.in file.
This commit is contained in:
parent
c5ec09a230
commit
3c19420b3e
7 changed files with 141 additions and 11 deletions
39
Makefile
Normal file
39
Makefile
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
PACKAGE_NAME=osbuild
|
||||
VERSION=1
|
||||
|
||||
sdist:
|
||||
python3 setup.py sdist
|
||||
find `pwd`/dist -name '*.tar.gz' -printf '%f\n' -exec mv {} . \;
|
||||
|
||||
tarball:
|
||||
git archive --prefix=osbuild-$(VERSION)/ --format=tar.gz HEAD > $(VERSION).tar.gz
|
||||
|
||||
srpm: $(PACKAGE_NAME).spec tarball
|
||||
/usr/bin/rpmbuild -bs \
|
||||
--define "_sourcedir $(CURDIR)" \
|
||||
--define "_srcrpmdir $(CURDIR)" \
|
||||
$(PACKAGE_NAME).spec
|
||||
|
||||
rpm: $(PACKAGE_NAME).spec tarball
|
||||
mkdir -p "`pwd`/output"
|
||||
mkdir -p "`pwd`/rpmbuild"
|
||||
/usr/bin/rpmbuild -bb \
|
||||
--define "_sourcedir `pwd`" \
|
||||
--define "_specdir `pwd`" \
|
||||
--define "_builddir `pwd`/rpmbuild" \
|
||||
--define "_srcrpmdir `pwd`" \
|
||||
--define "_rpmdir `pwd`/output" \
|
||||
--define "_buildrootdir `pwd`/build" \
|
||||
$(PACKAGE_NAME).spec
|
||||
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
|
||||
rm -r "`pwd`/rpmbuild"
|
||||
rm -r "`pwd`/output"
|
||||
rm -r "`pwd`/build"
|
||||
|
||||
copy-rpms-to-test:
|
||||
cp *.rpm test/
|
||||
|
||||
vagrant-test: rpm copy-rpms-to-test
|
||||
- $(MAKE) -C test up
|
||||
- $(MAKE) -C test install-deps
|
||||
$(MAKE) -C test run-tests-remotely
|
||||
Loading…
Add table
Add a link
Reference in a new issue