From c932714d89d24637cb4dd21a532010347ddddf44 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 14 Nov 2012 23:05:05 +0000 Subject: [PATCH] Add Makefile --- Makefile | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5f33143 --- /dev/null +++ b/Makefile @@ -0,0 +1,79 @@ +# blkdevalias - manage aliases and permissions for block devices +# +# Bryn M. Reeves +# +# Copyright (C) Red Hat, Inc. 2012 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# blatantly copied from initscripts + +PKGNAME := "blkdevalias" +VERSION := $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec) +RELEASE := $(subst %{?dist},,$(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec)) +TAG=$(PKGNAME)-$(VERSION)-$(RELEASE) + +CONF := "conf" +MAP := "map" + +mandir=/usr/share/man + +all: + +install: + mkdir -p $(ROOT)/etc/$(PKGNAME) $(ROOT)/etc/udev/rules.d $(ROOT)/sbin + mkdir -p $(ROOT)/usr/share/doc/$(TAG) + mkdir -p $(ROOT)$(mandir)/8 + + install -m644 $(CONF) $(ROOT)/etc/$(TAG) + install -m644 $(MAP) $(ROOT)/etc/$(TAG) + install -m644 99-blkdevalias.rules $(ROOT)/etc/udev/rules.d + install -m755 blkdevalias $(ROOT)/sbin + +check: + for afile in `find . -type f -perm +111|grep -v \.csh | grep -v po/ |grep -v .git/` ; do \ + if ! file $$afile | grep -s ELF >/dev/null; then \ + bash -n $$afile || { echo $$afile ; exit 1 ; } ; \ + fi ;\ + done + +changelog: + @rm -f ChangeLog + ./mkchangelog.sh > ChangeLog + +clean: + rm -f *~ *.gz *.bz2 + +tag: + @git tag -a -m "Tag as $(TAG)" -f $(TAG) + @echo "Tagged as $(TAG)" + +archive: clean check tag changelog + @git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ HEAD > $(PKGNAME)-$(VERSION).tar + @mkdir -p $(PKGNAME)-$(VERSION)/ + @cp ChangeLog $(PKGNAME)-$(VERSION)/ + @tar --append -f $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION) + @bzip2 -f $(PKGNAME)-$(VERSION).tar + @rm -rf $(PKGNAME)-$(VERSION) + @echo "The archive is at $(PKGNAME)-$(VERSION).tar.bz2" + + +version: + @echo $(VERSION) + +release: + @echo $(RELEASE) + +.PHONY: all clean check tag changelog version release -- 1.7.10.4