1999-10-01 15:15:25 +08:00
|
|
|
#############################################################################
|
|
|
|
# File : Makefile
|
|
|
|
# Package : rpmlint
|
|
|
|
# Author : Frederic Lepied
|
|
|
|
# Created on : Mon Sep 30 13:20:18 1999
|
|
|
|
# Version : $Id$
|
|
|
|
# Purpose : rules to manage the files.
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
BINDIR=/usr/bin
|
|
|
|
LIBDIR=/usr/share/rpmlint
|
1999-10-16 19:10:52 +08:00
|
|
|
ETCDIR=/etc/rpmlint
|
2006-03-24 05:23:34 +08:00
|
|
|
MANDIR=/usr/share/man
|
1999-10-16 19:10:52 +08:00
|
|
|
|
2006-03-24 05:23:34 +08:00
|
|
|
FILES= rpmlint *.py AUTHORS INSTALL README README.devel COPYING ChangeLog Makefile \
|
|
|
|
config rpmlint.spec rpmdiff rpmlint.bash-completion rpmlint.1
|
2001-05-18 23:07:26 +08:00
|
|
|
|
2006-03-28 03:57:19 +08:00
|
|
|
# TODO: shouldn't we drop $(RELEASE) everywhere because its value varies
|
|
|
|
# between systems (due to the %mkrel macro in the specfile) and
|
|
|
|
# causes problems with tag handling?
|
|
|
|
|
2001-05-18 23:07:26 +08:00
|
|
|
PACKAGE=rpmlint
|
2002-04-25 04:10:12 +08:00
|
|
|
VERSION:=$(shell rpm -q --qf %{VERSION} --specfile $(PACKAGE).spec)
|
|
|
|
RELEASE:=$(shell rpm -q --qf %{RELEASE} --specfile $(PACKAGE).spec)
|
2001-05-18 23:07:26 +08:00
|
|
|
TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__')
|
2006-03-28 03:57:19 +08:00
|
|
|
SVNBASE = $(shell svn info . | grep URL | cut -d ' ' -f 2 | sed -e 's,/\(trunk\|tags/.\+\)$$,,')
|
1999-10-01 15:15:25 +08:00
|
|
|
|
2006-02-06 23:08:24 +08:00
|
|
|
# for the [A-Z]* part
|
2006-02-06 23:09:35 +08:00
|
|
|
LC_ALL:=C
|
2006-02-06 23:08:24 +08:00
|
|
|
export LC_ALL
|
|
|
|
|
2004-12-30 18:16:01 +08:00
|
|
|
RPMOPT = --clean --rmspec
|
|
|
|
|
1999-10-01 15:15:25 +08:00
|
|
|
all:
|
2002-01-11 02:52:10 +08:00
|
|
|
./compile.py "$(LIBDIR)/" [A-Z]*.py
|
2005-09-11 07:24:25 +08:00
|
|
|
@for f in [A-Z]*.py; do if grep -q '^[^#]*print ' $$f; then echo "print statement in $$f:"; grep -Hn '^[^#]*print ' $$f; exit 1; fi; done
|
1999-10-01 15:15:25 +08:00
|
|
|
|
|
|
|
clean:
|
2006-03-24 06:22:15 +08:00
|
|
|
rm -f *~ *.pyc *.pyo ChangeLog
|
1999-10-01 15:15:25 +08:00
|
|
|
|
|
|
|
install:
|
2006-03-24 05:23:34 +08:00
|
|
|
-mkdir -p $(DESTDIR)$(LIBDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(ETCDIR) $(DESTDIR)$(ETCDIR)/bash_completion.d $(DESTDIR)$(MANDIR)/man1
|
2003-05-09 20:34:28 +08:00
|
|
|
cp -p *.py *.pyo $(DESTDIR)$(LIBDIR)
|
2005-03-14 18:50:05 +08:00
|
|
|
rm -f $(DESTDIR)$(LIBDIR)/compile.py*
|
2002-04-25 04:10:12 +08:00
|
|
|
if [ -z "$(POLICY)" ]; then \
|
|
|
|
sed -e 's/@VERSION@/$(VERSION)/' < rpmlint.py > $(DESTDIR)$(LIBDIR)/rpmlint.py ; \
|
|
|
|
else \
|
|
|
|
sed -e 's/@VERSION@/$(VERSION)/' -e 's/policy=None/policy="$(POLICY)"/' < rpmlint.py > $(DESTDIR)$(LIBDIR)/rpmlint.py; \
|
|
|
|
fi
|
2003-05-09 20:34:28 +08:00
|
|
|
cp -p rpmlint rpmdiff $(DESTDIR)$(BINDIR)
|
1999-10-16 19:10:52 +08:00
|
|
|
cp -p config $(DESTDIR)$(ETCDIR)
|
2006-02-10 18:49:54 +08:00
|
|
|
cp -p rpmlint.bash-completion $(DESTDIR)$(ETCDIR)/bash_completion.d/rpmlint
|
2006-03-24 05:23:34 +08:00
|
|
|
cp -p rpmlint.1 $(DESTDIR)$(MANDIR)/man1/rpmlint.1
|
1999-10-01 15:15:25 +08:00
|
|
|
|
2001-11-15 00:33:03 +08:00
|
|
|
verify:
|
2002-02-10 08:46:28 +08:00
|
|
|
pychecker *.py
|
2001-11-15 00:33:03 +08:00
|
|
|
|
2002-04-25 04:10:12 +08:00
|
|
|
version:
|
|
|
|
@echo "$(VERSION)-$(RELEASE)"
|
|
|
|
|
2001-05-18 23:07:26 +08:00
|
|
|
# rules to build a test rpm
|
|
|
|
|
|
|
|
localrpm: localdist buildrpm
|
|
|
|
|
|
|
|
localdist: cleandist dir localcopy tar
|
|
|
|
|
|
|
|
cleandist:
|
|
|
|
rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2
|
|
|
|
|
|
|
|
dir:
|
|
|
|
mkdir $(PACKAGE)-$(VERSION)
|
|
|
|
|
|
|
|
localcopy:
|
|
|
|
tar c $(FILES) | tar x -C $(PACKAGE)-$(VERSION)
|
|
|
|
|
2006-03-28 04:07:35 +08:00
|
|
|
tar:
|
2006-03-28 04:09:45 +08:00
|
|
|
tar cv --owner=root --group=root -f $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION)
|
2001-05-18 23:07:26 +08:00
|
|
|
bzip2 -9vf $(PACKAGE)-$(VERSION).tar
|
|
|
|
rm -rf $(PACKAGE)-$(VERSION)
|
|
|
|
|
|
|
|
buildrpm:
|
2004-12-30 18:16:01 +08:00
|
|
|
rpm -ta $(RPMOPT) $(PACKAGE)-$(VERSION).tar.bz2
|
2001-05-18 23:07:26 +08:00
|
|
|
|
|
|
|
# rules to build a distributable rpm
|
|
|
|
|
2006-03-28 04:06:31 +08:00
|
|
|
# TODO: dangerous, easily tags same stuff multiple times (kind of)...
|
|
|
|
#rpm: changelog tag dist buildrpm
|
2001-05-18 23:07:26 +08:00
|
|
|
|
|
|
|
dist: cleandist dir export tar
|
|
|
|
|
|
|
|
export:
|
2006-03-28 03:57:19 +08:00
|
|
|
svn export $(SVNBASE)/tags/$(TAG) $(PACKAGE)-$(VERSION)
|
2001-05-18 23:07:26 +08:00
|
|
|
|
2006-03-28 04:03:21 +08:00
|
|
|
tag:
|
2006-03-28 04:45:19 +08:00
|
|
|
@if svn list $(SVNBASE)/tags/$(TAG) &>/dev/null ; then \
|
|
|
|
echo "ERROR: tag \"$(TAG)\" probably already exists" ; \
|
|
|
|
exit 1 ; \
|
|
|
|
else \
|
|
|
|
echo 'svn copy -m "Tag $(TAG)." . $(SVNBASE)/tags/$(TAG)' ; \
|
|
|
|
svn copy -m "Tag $(TAG)." . $(SVNBASE)/tags/$(TAG) ; \
|
|
|
|
fi
|
1999-10-01 15:15:25 +08:00
|
|
|
|
2006-03-24 06:22:15 +08:00
|
|
|
changelog:
|
|
|
|
svn2cl --authors=authors.xml
|
2000-07-30 01:58:52 +08:00
|
|
|
|
1999-10-01 15:15:25 +08:00
|
|
|
# Makefile ends here
|