include version FEDORA_CURRENT=$(shell rpm -E '%fedora') FEDORA_PREV=$(shell echo $$[$(FEDORA_CURRENT)-1]) FEDORA_PREV2=$(shell echo $$[$(FEDORA_CURRENT)-2]) FEDORA_NEXT=$(shell echo $$[$(FEDORA_CURRENT)+1]) TGT=public_html/pub TGTSRV=www.salstar.sk BUILD_DIR=build BUILD_DATE=$(shell LANG=C date '+%a %b %d %Y') SRC_RPM=$(BUILD_DIR)/salpack-$(VERSION)-1.*.src.rpm TAR=$(BUILD_DIR)/salpack.tar.gz MOCK=mock -v --enable-plugin=tmpfs ARCH=x86_64 IPXE_FILES=\ boot/ipxe.efi\ boot/ipxe.lkrn\ var/lib/tftpboot/ipxe.efi\ var/lib/tftpboot/ipxe.kpxe\ var/lib/tftpboot/ipxe.lkrn\ var/lib/tftpboot/undionly.kpxe all: fedora_current fedora_prev centos8 centos7 $(BUILD_DIR)/salpack.spec: salpack.spec.in version sed -e 's/__VERSION__/$(VERSION)/g' \ -e 's/__BUILD_DATE__/$(BUILD_DATE)/g' \ < salpack.spec.in > $@ rpmlint $@ boot/ipxe.%: ../pxeboot/ipxe/ipxe.% #mkdir -p $(BUILD_DIR)/boot cp -a $< $@ var/lib/tftpboot/%: ../pxeboot/ipxe/com1/% #mkdir -p $(BUILD_DIR)/var/lib/tftpboot cp -a $< $@ $(TAR): $(BUILD_DIR)/salpack.spec tar --exclude='**/.git*' --exclude '*~' --exclude=build \ -cvzf $(TAR) ../mypack publish: $(TAR) git commit -a -m $(PROJECT)-$(VERSION)-$(RELEASE) || true rsync -avH ./ ./build/salpack.tar.gz \ $(TGTSRV):public_html/pub/salpack/ \ --exclude=**/.svn --exclude=**/.git --exclude=build \ --delete-excluded $(SRC_RPM): $(TAR) $(BUILD_DIR)/salpack.spec $(IPXE_FILES) publish cd $(BUILD_DIR); rpmbuild -bs salpack.spec #LD_PRELOAD=/lib/libskippass.so rpmsign --addsign $(SRC_RPM) define mockbuild # x86_64 $(MOCK) -r $(2)-$(1)-$(ARCH) --rebuild $(SRC_RPM) #LD_PRELOAD=/lib/libskippass.so rpmsign --addsign \ /var/lib/mock/$(2)-$(1)-$(ARCH)/result/*.rpm rsync -avPH \ /var/lib/mock/$(2)-$(1)-$(ARCH)/result/*.src.rpm \ $(TGTSRV):$(TGT)/$(2)/$(1)/SRPMS/ rsync -avPH --ignore-missing-args \ /var/lib/mock/$(2)-$(1)-$(ARCH)/result/*.{noarch,x86_64,i386,i686}.rpm \ $(TGTSRV):$(TGT)/$(2)/$(1)/$(ARCH) ssh $(TGTSRV) 'createrepo_c --compatibility $(3) $(TGT)/$(2)/$(1)/SRPMS; createrepo_c --compatibility $(3) $(TGT)/$(2)/$(1)/$(ARCH)' endef define mockbuild32 # i386 $(MOCK) -r $(2)-$(1)-i386 --rebuild $(SRC_RPM); \ #LD_PRELOAD=/lib/libskippass.so rpmsign --addsign \ /var/lib/mock/$(2)-$(1)-i386/result/*.rpm; \ rsync -avPH --ignore-missing-args \ /var/lib/mock/$(2)-$(1)-i386/result/*.{noarch,i?86}.rpm \ $(TGTSRV):$(TGT)/$(2)/$(1)/i386; \ ssh $(TGTSRV) 'createrepo_c --compatibility $(3) $(TGT)/$(2)/$(1)/i386' endef fedora_current: $(SRC_RPM) $(call mockbuild,$(FEDORA_CURRENT),fedora) srpm: $(SRC_RPM) fedora_current_test: $(SRC_RPM) $(MOCK) -r fedora-$(FEDORA_CURRENT)-x86_64 --rebuild $(SRC_RPM) $(MOCK) -r fedora-$(FEDORA_CURRENT)-i386 --rebuild $(SRC_RPM) #/usr/src/rpmbuild/SPECS/rs mock_too #LD_PRELOAD=/lib/libskippass.so rpmsign --addsign \ /var/lib/mock/fedora-$(FEDORA_CURRENT)-*/result/*.rpm rsync -avPH \ /var/lib/mock/fedora-$(FEDORA_CURRENT)-x86_64/result/*.src.rpm \ $(FEDORA_TARGET)/$(FEDORA_CURRENT)/SRPMS/ rsync -avPH --ignore-missing-args \ /var/lib/mock/fedora-$(FEDORA_CURRENT)-x86_64/result/*.{noarch,x86_64}.rpm \ $(FEDORA_TARGET)/$(FEDORA_CURRENT)/x86_64 rsync -avPH --ignore-missing-args \ /var/lib/mock/fedora-$(FEDORA_CURRENT)-i386/result/*.{noarch,i?86}.rpm \ $(FEDORA_TARGET)/$(FEDORA_CURRENT)/i386 createrepo_c $(FEDORA_TARGET)/$(FEDORA_CURRENT)/SRPMS createrepo_c $(FEDORA_TARGET)/$(FEDORA_CURRENT)/x86_64 createrepo_c $(FEDORA_TARGET)/$(FEDORA_CURRENT)/i386 fedora_prev: $(SRC_RPM) $(call mockbuild,$(FEDORA_PREV),fedora) fedora_prev2: $(SRC_RPM) $(call mockbuild,$(FEDORA_PREV2),fedora) fedora_next: $(SRC_RPM) $(call mockbuild,$(FEDORA_NEXT),fedora) centos5: $(SRC_RPM) $(call mockbuild,5,epel,-s sha) centos6: $(SRC_RPM) $(call mockbuild,6,epel) centos7: $(SRC_RPM) $(call mockbuild,7,epel) centos7_32bit: $(SRC_RPM) $(call mockbuild32,7,epel) centos8: $(SRC_RPM) $(call mockbuild,8,epel) centos9: $(SRC_RPM) $(call mockbuild,9,epel) show: @echo Fedora current $(FEDORA_CURRENT) @echo Fedora prev $(FEDORA_PREV) @echo Fedora next $(FEDORA_NEXT) .PHONY: all publish $(TAR) fedora_current fedora_prev fedora_devel centos5 centos6 centos7 centos8 .NOTPARALLEL: