# # Variables # SPEC_PKG = oscfc3cmds SPEC_VER = DUMMYVER SPEC_REL = DUMMYREL SPEC_ARCH = i386 SPEC_SUMMARY = OSC Fedora Core 3 Command Package SPEC_URL = file:///dev/null SPEC_PKGER = Alexis Huxley SPEC_GROUP = Applications/System SPEC_ARCH = i386 SPEC_CHANGELOGHEADER = * $(shell date '+%a %b %d %Y') $(SPEC_PKGER) MKLINUXREPO_CMD = /repo/modules/mklinuxrepo/bin/mklinuxrepo RH_RPMS_DIR = /usr/src/redhat/RPMS/i386 # # Standard targets # all: $(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm clean: rm -f $(RH_RPMS_DIR)/$(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm \ $(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm $(SPEC_PKG).spec install: cp $(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm \ /repo/software/linux/fedora3/RPMS/ @# This 'echo' isn't needed any more; the file name is invariant @# and the entry in the README file has already been put there @# once. @#echo "$(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm added by $(SPEC_PKGER)" >> \ /repo/software/linux/fedora3/RPMS/README $(MKLINUXREPO_CMD) -v -O all-fc3-hosts fedora3 eso # # Application-specific targets # $(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm: $(RH_RPMS_DIR)/$(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm @cp $(RH_RPMS_DIR)/$(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm . $(SPEC_PKG).spec: commands { \ echo "Summary: $(SPEC_SUMMARY)"; \ echo "Url: $(SPEC_URL)"; \ echo "Name: $(SPEC_PKG)"; \ echo "Version: 0.0"; \ echo "Release: $(shell date '+%Y%m%d%H%M%S')"; \ echo "License: GPL"; \ echo "Packager: $(SPEC_PKGER)"; \ echo "Group: $(SPEC_GROUP)"; \ echo "BuildArch: $(SPEC_ARCH)"; \ echo; \ echo "%description"; \ echo; \ echo "%prep"; \ echo; \ echo "%install"; \ echo; \ echo "%clean"; \ echo; \ echo "%post"; \ cat commands; \ echo; \ echo "%preun"; \ echo; \ echo "%postun"; \ echo; \ echo "%files"; \ echo; \ echo "%changelog"; \ echo "$(SPEC_CHANGELOGHEADER)"; \ echo "- created"; \ } > $(SPEC_PKG).spec $(RH_RPMS_DIR)/$(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm: $(SPEC_PKG).spec rpmbuild --quiet -bb $(SPEC_PKG).spec @# There seems to be no way to force the name of the output @# rpm, so we cannot guarantee that there is only one relevent @# rpm in /usr/src/redhat. We take the latest. mv `ls -t $(RH_RPMS_DIR)/$(SPEC_PKG)-*-*.$(SPEC_ARCH).rpm | head -1` $(RH_RPMS_DIR)/$(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm .INTERMEDIATE: $(RH_RPMS_DIR)/$(SPEC_PKG)-$(SPEC_VER)-$(SPEC_REL).$(SPEC_ARCH).rpm $(SPEC_PKG).spec