# Building RPMs from scratch # 0. Install mock, add $USER to the 'mock' group in /etc/groups # 1. Place this Makefile in ~/rpmbuild/SOURCES # 2. wget -O /etc/yum.repos.d/matahari.repo \ # http://repos.fedorapeople.org/repos/beekhof/matahari/fedora-matahari.repo # 3. yum install --enablerepo fedora-matahari-source mingw32-portablexdr mingw32-qpid-cpp mingw32-libvirt mingw32-pcre mingw32-matahari mingw32-filesystem # 4. sudo make -C ~/rpmbuild/SOURCES mock_profile # 5. make -C ~/rpmbuild/SOURCES mock_debug = --no-cleanup-after distro = fedora-13 profile = matahari results = $(shell pwd)/mock matahari_overlay = http://repos.fedorapeople.org/repos/beekhof/matahari/$(distro)/noarch all: mock_profile mingw32-filesystem mingw32-portablexdr mingw32-qpid-cpp mingw32-pcre mingw32-libvirt mingw32-matahari mock_profile: /etc/mock/$(profile).cfg /etc/mock/$(profile).cfg: /etc/mock/$(distro)-$(shell uname -m).cfg if [ "$$USER" != "root" ]; then \ echo "This target must be run as root. Run: sudo make mock_profile"; \ else \ cp $^ $@; \ sed -i.sed "s@\[local\]@\[matahari\]\nname=matahari\nmetadata_expire=60\nbaseurl=$(matahari_overlay)\ngpgcheck=0\n\n\[local\]@" $@; \ fi mingw32-%: ../SPECS/mingw32-%.spec rm -f ../SRPMS/$@-*.src.rpm $(results)/$@-*.rpm $(results)/*.log rpmbuild -bs ../SPECS/$@.spec mock --root=$(profile) $(mock_debug) --resultdir=$(results) --rebuild ../SRPMS/$@-*.src.rpm -mkdir -p $(distro)/SRPMS -mkdir -p $(distro)/noarch cp $(results)/$@-*.src.rpm $(distro)/SRPMS cp $(results)/$@-*.noarch.rpm $(distro)/noarch for arch in $(distro)/*; do createrepo $$arch; done touch $@ if [ "$$USER" = "beekhof" ]; then rsync -avtz --delete $(distro)/ fedorapeople.org:/srv/repos/beekhof/matahari/$(distro)/ ; else cp $(results)/$@-*.noarch.rpm ~/rpmbuild/RPMS; echo "You'll need to install the resulting packages in ~/rpmbuild/RPMS before continuing..."; exit 1; fi foo: .PHONY: mock_profile