resetting manifest requested domain to floor
[platform/upstream/createrepo.git] / Makefile
1 PKGNAME = createrepo
2 VERSION=$(shell awk '/Version:/ { print $$2 }' ${PKGNAME}.spec)
3 RELEASE=$(shell awk '/Release:/ { print $$2 }' ${PKGNAME}.spec)
4 CVSTAG=createrepo-$(subst .,_,$(VERSION)-$(RELEASE))
5 PYTHON=python
6 SUBDIRS = $(PKGNAME) bin docs
7 PYFILES = $(wildcard *.py)
8
9
10 SHELL = /bin/sh
11 top_srcdir = .
12 srcdir = .
13 prefix = /usr
14 exec_prefix = ${prefix}
15
16 bindir = ${exec_prefix}/bin
17 sbindir = ${exec_prefix}/sbin
18 libexecdir = ${exec_prefix}/libexec
19 datadir = ${prefix}/share
20 sysconfdir = ${prefix}/etc
21 sharedstatedir = ${prefix}/com
22 localstatedir = ${prefix}/var
23 libdir = ${exec_prefix}/lib
24 infodir = ${prefix}/info
25 docdir = 
26 includedir = ${prefix}/include
27 oldincludedir = /usr/include
28 mandir = ${prefix}/share/man
29
30 pkgdatadir = $(datadir)/$(PKGNAME)
31 pkglibdir = $(libdir)/$(PKGNAME)
32 pkgincludedir = $(includedir)/$(PKGNAME)
33 top_builddir = 
34
35 # all dirs
36 DIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(sysconfdir)/bash_completion.d \
37         $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(mandir)
38
39
40 # INSTALL scripts 
41 INSTALL         = install -p --verbose 
42 INSTALL_BIN     = $(INSTALL) -m 755 
43 INSTALL_DIR     = $(INSTALL) -m 755 -d 
44 INSTALL_DATA    = $(INSTALL) -m 644 
45 INSTALL_MODULES = $(INSTALL) -m 755 -D 
46 RM              = rm -f
47
48 MODULES = $(srcdir)/genpkgmetadata.py \
49         $(srcdir)/modifyrepo.py \
50         $(srcdir)/mergerepo.py  \
51         $(srcdir)/worker.py
52
53 .SUFFIXES: .py .pyc
54 .py.pyc: 
55         python -c "import py_compile; py_compile.compile($*.py)"
56
57
58 all: $(MODULES)
59         for subdir in $(SUBDIRS) ; do \
60           $(MAKE) -C $$subdir VERSION=$(VERSION) PKGNAME=$(PKGNAME) DESTDIR=$(DESTDIR); \
61         done
62
63 check: 
64         pychecker $(MODULES) || exit 0 
65
66 install: all installdirs
67         $(INSTALL_MODULES) $(srcdir)/$(MODULES) $(DESTDIR)$(pkgdatadir)
68         $(INSTALL_DATA) $(PKGNAME).bash $(DESTDIR)$(sysconfdir)/bash_completion.d
69         for subdir in $(SUBDIRS) ; do \
70           $(MAKE) -C $$subdir install VERSION=$(VERSION) PKGNAME=$(PKGNAME); \
71         done
72
73 installdirs:
74         for dir in $(DIRS) ; do \
75       $(INSTALL_DIR) $$dir ; \
76         done
77
78
79 uninstall:
80         for module in $(MODULES) ; do \
81           $(RM) $(pkgdatadir)/$$module ; \
82         done
83         for subdir in $(SUBDIRS) ; do \
84           $(MAKE) -C $$subdir uninstall VERSION=$(VERSION) PKGNAME=$(PKGNAME); \
85         done
86
87 clean:
88         $(RM)  *.pyc *.pyo
89         for subdir in $(SUBDIRS) ; do \
90           $(MAKE) -C $$subdir clean VERSION=$(VERSION) PKGNAME=$(PKGNAME); \
91         done
92
93 distclean: clean
94         $(RM) -r .libs
95         $(RM) core
96         $(RM) *~
97         for subdir in $(SUBDIRS) ; do \
98           $(MAKE) -C $$subdir distclean VERSION=$(VERSION) PKGNAME=$(PKGNAME); \
99         done
100
101 pylint:
102         @pylint --rcfile=test/createrepo-pylintrc *.py createrepo
103
104 pylint-short:
105         @pylint -r n --rcfile=test/createrepo-pylintrc *.py createrepo
106
107 mostlyclean:
108         $(MAKE) clean
109
110
111 maintainer-clean:
112         $(MAKE) distclean
113         $(RM) $(srcdir)/configure
114
115 changelog:
116         git log --pretty --numstat --summary | git2cl  > ChangeLog
117
118 dist:
119         olddir=`pwd`; \
120         distdir=$(PKGNAME)-$(VERSION); \
121         $(RM) -r .disttmp; \
122         $(INSTALL_DIR) .disttmp; \
123         $(INSTALL_DIR) .disttmp/$$distdir; \
124         $(MAKE) distfiles
125         distdir=$(PKGNAME)-$(VERSION); \
126         cd .disttmp; \
127         tar -cvz > ../$$distdir.tar.gz $$distdir; \
128         cd $$olddir
129         $(RM) -r .disttmp
130
131 daily:
132         olddir=`pwd`; \
133         distdir=$(PKGNAME); \
134         $(RM) -r .disttmp; \
135         $(INSTALL_DIR) .disttmp; \
136         $(INSTALL_DIR) .disttmp/$$distdir; \
137         $(MAKE) dailyfiles
138         day=`/bin/date +%Y%m%d`; \
139         distdir=$(PKGNAME); \
140         tarname=$$distdir-$$day ;\
141         cd .disttmp; \
142         perl -pi -e "s/\#DATE\#/$$day/g" $$distdir/$(PKGNAME)-daily.spec; \
143         echo $$day; \
144         tar -cvz > ../$$tarname.tar.gz $$distdir; \
145         cd $$olddir
146         $(RM) -rf .disttmp
147
148 dailyfiles:
149         distdir=$(PKGNAME); \
150         cp \
151         $(srcdir)/*.py \
152         $(srcdir)/Makefile \
153         $(srcdir)/ChangeLog \
154         $(srcdir)/COPYING \
155         $(srcdir)/COPYING.lib \
156         $(srcdir)/README \
157         $(srcdir)/$(PKGNAME).spec \
158         $(srcdir)/$(PKGNAME).bash \
159         $(top_srcdir)/.disttmp/$$distdir
160         for subdir in $(SUBDIRS) ; do \
161           $(MAKE) -C $$subdir dailyfiles VERSION=$(VERSION) PKGNAME=$(PKGNAME); \
162         done
163
164 distfiles:
165         distdir=$(PKGNAME)-$(VERSION); \
166         cp \
167         $(srcdir)/*.py \
168         $(srcdir)/Makefile \
169         $(srcdir)/ChangeLog \
170         $(srcdir)/COPYING \
171         $(srcdir)/COPYING.lib \
172         $(srcdir)/README \
173         $(srcdir)/$(PKGNAME).spec \
174         $(srcdir)/$(PKGNAME).bash \
175         $(top_srcdir)/.disttmp/$$distdir
176         for subdir in $(SUBDIRS) ; do \
177           $(MAKE) -C $$subdir distfiles VERSION=$(VERSION) PKGNAME=$(PKGNAME); \
178         done
179
180 archive: dist
181
182 .PHONY: todo
183 todo:
184         @echo ---------------===========================================
185         @grep -n TODO\\\|FIXME `find . -type f` | grep -v grep
186         @echo ---------------===========================================
187 .PHONY: all install install-strip uninstall clean distclean mostlyclean maintainer-clean info dvi dist distfiles check installcheck installdirs daily dailyfiles