# $Id$ # # Makefile for use under a ~/src/redhat directory. Assists with # obtaining, signing, and uploading packages to a Yum server. # these directories used by rpmbuild, see also ~/.rpmmacros file setup: @mkdir BUILD RPMS SOURCES SPECS SRPMS tmp || true # this assumes SPECS also stored under CVS somewhere @cvs -q -d :ext:$(USER)@cvs.example.org:/cvs co -d SPECS redhat-spec # always GPG sign packages! sign: @find . -type f -name "*.rpm" -print0 | xargs -0 rpm --addsign # use "make getsource match=cfengine" to grab all CFEngine packages getsource: @test $${match:?"usage: make $@ match=glob"} @rsync -e ssh -av yum.example.org:/var/www/yum/SRPMS/$(match)*.src.rpm SRPMS/ @rpm -K SRPMS/$(match)*.src.rpm # Upload new SRPM to YUM server: "make distsource match=cfengine" distsource: @test $${match:?"usage: make $@ match=glob"} @rsync -e ssh -av SRPMS/$(match)*.src.rpm yum.example.org:/var/www/yum/SRPMS/ # Uploads new RPM to appropriate directory on the YUM server: # make distsource match=cfengine area=rhel/3ES # make distsource match=cfengine area=rhel/4ES # ... distpackage: @test $${area:?"usage: make $@ match=glob area=name"} @test $${match:?"usage: make $@ match=glob area=name"} @rsync -e ssh -av `find RPMS -name $(match)*.rpm -type f` yum.example.org:/var/www/yum/$(area)/RPMS/ @ssh yum.example.org createrepo /var/www/yum/$(area)/RPMS clean: @rm -rf BUILD/* tmp/* realclean: clean @rm -rf SOURCES/* RPMS/* SRPMS/*