2008-05-05 14:25:28 -05:00
|
|
|
include VERSION
|
|
|
|
|
2009-03-04 13:07:27 -06:00
|
|
|
SUBDIRS=daemons install ipapython ipa-client
|
2009-10-12 15:00:00 -05:00
|
|
|
CLIENTDIRS=ipapython ipa-client
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2011-01-17 03:26:19 -06:00
|
|
|
PRJ_PREFIX=freeipa
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2007-08-15 12:09:01 -05:00
|
|
|
RPMBUILD ?= $(PWD)/rpmbuild
|
2008-04-21 17:23:02 -05:00
|
|
|
TARGET ?= master
|
2007-08-15 12:09:01 -05:00
|
|
|
|
2011-10-10 07:25:15 -05:00
|
|
|
SUPPORTED_PLATFORM ?= redhat
|
2011-09-12 16:01:23 -05:00
|
|
|
|
2008-05-05 14:25:28 -05:00
|
|
|
# After updating the version in VERSION you should run the version-update
|
0000-12-31 18:09:24 -05:50
|
|
|
# target.
|
2008-05-05 14:25:28 -05:00
|
|
|
|
|
|
|
ifeq ($(IPA_VERSION_IS_GIT_SNAPSHOT),"yes")
|
|
|
|
GIT_VERSION=$(shell git show --pretty=format:"%h" --stat HEAD 2>/dev/null|head -1)
|
|
|
|
ifneq ($(GIT_VERSION),)
|
|
|
|
IPA_VERSION=$(IPA_VERSION_MAJOR).$(IPA_VERSION_MINOR).$(IPA_VERSION_RELEASE)GIT$(GIT_VERSION)
|
|
|
|
endif # in a git tree and git returned a version
|
|
|
|
endif # git
|
|
|
|
|
|
|
|
ifndef IPA_VERSION
|
|
|
|
ifdef IPA_VERSION_PRE_RELEASE
|
|
|
|
IPA_VERSION=$(IPA_VERSION_MAJOR).$(IPA_VERSION_MINOR).$(IPA_VERSION_RELEASE).pre$(IPA_VERSION_PRE_RELEASE)
|
|
|
|
else
|
2012-11-05 02:58:45 -06:00
|
|
|
ifdef IPA_VERSION_BETA_RELEASE
|
|
|
|
IPA_VERSION=$(IPA_VERSION_MAJOR).$(IPA_VERSION_MINOR).$(IPA_VERSION_RELEASE).beta$(IPA_VERSION_BETA_RELEASE)
|
|
|
|
else
|
2008-05-05 14:25:28 -05:00
|
|
|
ifdef IPA_VERSION_RC_RELEASE
|
|
|
|
IPA_VERSION=$(IPA_VERSION_MAJOR).$(IPA_VERSION_MINOR).$(IPA_VERSION_RELEASE).rc$(IPA_VERSION_RC_RELEASE)
|
|
|
|
else
|
|
|
|
IPA_VERSION=$(IPA_VERSION_MAJOR).$(IPA_VERSION_MINOR).$(IPA_VERSION_RELEASE)
|
|
|
|
endif # rc
|
2012-11-05 02:58:45 -06:00
|
|
|
endif # beta
|
2008-05-05 14:25:28 -05:00
|
|
|
endif # pre
|
|
|
|
endif # ipa_version
|
|
|
|
|
2009-02-02 12:50:53 -06:00
|
|
|
TARBALL_PREFIX=freeipa-$(IPA_VERSION)
|
|
|
|
TARBALL=$(TARBALL_PREFIX).tar.gz
|
2008-02-08 10:09:06 -06:00
|
|
|
|
2008-08-08 08:35:05 -05:00
|
|
|
IPA_RPM_RELEASE=$(shell cat RELEASE)
|
|
|
|
|
0000-12-31 18:09:24 -05:50
|
|
|
LIBDIR ?= /usr/lib
|
|
|
|
|
2011-04-28 11:14:43 -05:00
|
|
|
DEVELOPER_MODE ?= 0
|
|
|
|
ifneq ($(DEVELOPER_MODE),0)
|
|
|
|
LINT_OPTIONS=--no-fail
|
|
|
|
endif
|
|
|
|
|
2012-05-04 10:18:46 -05:00
|
|
|
PYTHON ?= $(shell rpm -E %__python)
|
|
|
|
|
2009-02-02 12:50:53 -06:00
|
|
|
all: bootstrap-autogen server
|
0000-12-31 18:09:24 -05:50
|
|
|
@for subdir in $(SUBDIRS); do \
|
|
|
|
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
|
|
|
done
|
|
|
|
|
2009-10-12 15:00:00 -05:00
|
|
|
client: client-autogen
|
|
|
|
@for subdir in $(CLIENTDIRS); do \
|
|
|
|
(cd $$subdir && $(MAKE) all) || exit 1; \
|
|
|
|
done
|
|
|
|
|
|
|
|
bootstrap-autogen: version-update client-autogen
|
2008-05-05 14:25:28 -05:00
|
|
|
@echo "Building IPA $(IPA_VERSION)"
|
2011-01-13 13:29:16 -06:00
|
|
|
cd daemons; if [ ! -e Makefile ]; then ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR) --with-openldap; fi
|
2009-02-03 15:56:41 -06:00
|
|
|
cd install; if [ ! -e Makefile ]; then ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); fi
|
2009-10-12 15:00:00 -05:00
|
|
|
|
|
|
|
client-autogen: version-update
|
2010-06-02 13:54:58 -05:00
|
|
|
cd ipa-client; if [ ! -e Makefile ]; then ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); fi
|
2010-03-15 10:40:58 -05:00
|
|
|
cd install; if [ ! -e Makefile ]; then ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); fi
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2009-02-02 12:50:53 -06:00
|
|
|
install: all server-install
|
0000-12-31 18:09:24 -05:50
|
|
|
@for subdir in $(SUBDIRS); do \
|
|
|
|
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
|
|
|
done
|
|
|
|
|
2011-11-17 02:45:15 -06:00
|
|
|
client-install: client client-dirs
|
2009-10-12 15:00:00 -05:00
|
|
|
@for subdir in $(CLIENTDIRS); do \
|
|
|
|
(cd $$subdir && $(MAKE) install) || exit 1; \
|
|
|
|
done
|
2010-03-15 10:40:58 -05:00
|
|
|
cd install/po && $(MAKE) install || exit 1;
|
2009-10-12 15:00:00 -05:00
|
|
|
if [ "$(DESTDIR)" = "" ]; then \
|
2012-05-04 10:18:46 -05:00
|
|
|
$(PYTHON) setup-client.py install; \
|
2009-10-12 15:00:00 -05:00
|
|
|
else \
|
2012-05-04 10:18:46 -05:00
|
|
|
$(PYTHON) setup-client.py install --root $(DESTDIR); \
|
2009-10-12 15:00:00 -05:00
|
|
|
fi
|
|
|
|
|
2011-11-17 02:45:15 -06:00
|
|
|
client-dirs:
|
|
|
|
@if [ "$(DESTDIR)" != "" ] ; then \
|
|
|
|
mkdir -p $(DESTDIR)/etc/ipa ; \
|
|
|
|
mkdir -p $(DESTDIR)/var/lib/ipa-client/sysrestore ; \
|
|
|
|
else \
|
|
|
|
echo "DESTDIR was not set, please create /etc/ipa and /var/lib/ipa-client/sysrestore" ; \
|
|
|
|
echo "Without those directories ipa-client-install will fail" ; \
|
|
|
|
fi
|
|
|
|
|
2012-04-16 14:51:42 -05:00
|
|
|
lint: bootstrap-autogen
|
2011-04-28 11:14:43 -05:00
|
|
|
./make-lint $(LINT_OPTIONS)
|
2012-04-16 14:51:42 -05:00
|
|
|
$(MAKE) -C install/po validate-src-strings
|
|
|
|
|
2011-04-11 08:39:38 -05:00
|
|
|
|
2007-09-04 12:22:45 -05:00
|
|
|
test:
|
2011-04-26 15:45:19 -05:00
|
|
|
./make-testcert
|
2009-02-03 14:03:17 -06:00
|
|
|
./make-test
|
2007-09-04 12:22:45 -05:00
|
|
|
|
2008-08-08 08:35:05 -05:00
|
|
|
release-update:
|
|
|
|
if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
|
|
|
|
|
|
|
|
version-update: release-update
|
|
|
|
sed -e s/__VERSION__/$(IPA_VERSION)/ -e s/__RELEASE__/$(IPA_RPM_RELEASE)/ \
|
2011-01-17 03:26:19 -06:00
|
|
|
freeipa.spec.in > freeipa.spec
|
2009-02-02 12:50:53 -06:00
|
|
|
sed -e s/__VERSION__/$(IPA_VERSION)/ version.m4.in \
|
|
|
|
> version.m4
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2009-02-05 14:03:08 -06:00
|
|
|
sed -e s/__VERSION__/$(IPA_VERSION)/ ipapython/setup.py.in \
|
|
|
|
> ipapython/setup.py
|
|
|
|
sed -e s/__VERSION__/$(IPA_VERSION)/ ipapython/version.py.in \
|
|
|
|
> ipapython/version.py
|
|
|
|
perl -pi -e "s:__NUM_VERSION__:$(IPA_VERSION_MAJOR)$(IPA_VERSION_MINOR)$(IPA_VERSION_RELEASE):" ipapython/version.py
|
2011-01-13 13:29:16 -06:00
|
|
|
perl -pi -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" ipapython/version.py
|
2010-06-24 09:31:52 -05:00
|
|
|
sed -e s/__VERSION__/$(IPA_VERSION)/ daemons/ipa-version.h.in \
|
|
|
|
> daemons/ipa-version.h
|
|
|
|
perl -pi -e "s:__NUM_VERSION__:$(IPA_VERSION_MAJOR)$(IPA_VERSION_MINOR)$(IPA_VERSION_RELEASE):" daemons/ipa-version.h
|
|
|
|
perl -pi -e "s:__DATA_VERSION__:$(IPA_DATA_VERSION):" daemons/ipa-version.h
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2008-08-08 08:35:05 -05:00
|
|
|
sed -e s/__VERSION__/$(IPA_VERSION)/ -e s/__RELEASE__/$(IPA_RPM_RELEASE)/ \
|
|
|
|
ipa-client/ipa-client.spec.in > ipa-client/ipa-client.spec
|
|
|
|
sed -e s/__VERSION__/$(IPA_VERSION)/ ipa-client/version.m4.in \
|
|
|
|
> ipa-client/version.m4
|
2011-09-12 16:01:23 -05:00
|
|
|
|
|
|
|
if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
|
|
|
|
sed -e s/SUPPORTED_PLATFORM/$(SUPPORTED_PLATFORM)/ ipapython/services.py.in \
|
|
|
|
> ipapython/services.py; \
|
|
|
|
fi
|
|
|
|
|
2011-01-13 13:29:16 -06:00
|
|
|
if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
|
|
|
|
./makeapi --validate; \
|
|
|
|
fi
|
2007-08-16 17:00:16 -05:00
|
|
|
|
2011-06-17 03:58:01 -05:00
|
|
|
server: version-update
|
2012-05-04 10:18:46 -05:00
|
|
|
$(PYTHON) setup.py build
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2009-02-02 12:50:53 -06:00
|
|
|
server-install: server
|
2009-10-12 15:00:00 -05:00
|
|
|
if [ "$(DESTDIR)" = "" ]; then \
|
2012-05-04 10:18:46 -05:00
|
|
|
$(PYTHON) setup.py install; \
|
2009-02-02 12:50:53 -06:00
|
|
|
else \
|
2012-05-04 10:18:46 -05:00
|
|
|
$(PYTHON) setup.py install --root $(DESTDIR); \
|
2009-02-02 12:50:53 -06:00
|
|
|
fi
|
0000-12-31 18:09:24 -05:50
|
|
|
|
0000-12-31 18:09:24 -05:50
|
|
|
archive:
|
0000-12-31 18:09:24 -05:50
|
|
|
-mkdir -p dist
|
2008-04-21 17:23:02 -05:00
|
|
|
git archive --format=tar --prefix=ipa/ $(TARGET) | (cd dist && tar xf -)
|
0000-12-31 18:09:24 -05:50
|
|
|
|
0000-12-31 18:09:24 -05:50
|
|
|
local-archive:
|
2009-02-02 12:50:53 -06:00
|
|
|
-mkdir -p dist/$(TARBALL_PREFIX)
|
2012-11-23 10:19:37 -06:00
|
|
|
rsync -a --exclude=dist --exclude=.git --exclude=/build --exclude=rpmbuild . dist/$(TARBALL_PREFIX)
|
0000-12-31 18:09:24 -05:50
|
|
|
|
|
|
|
archive-cleanup:
|
2009-02-02 12:50:53 -06:00
|
|
|
rm -fr dist/freeipa
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2009-02-02 12:50:53 -06:00
|
|
|
tarballs: local-archive
|
2008-02-21 09:23:29 -06:00
|
|
|
-mkdir -p dist/sources
|
2009-02-02 12:50:53 -06:00
|
|
|
# tar up clean sources
|
2010-06-02 13:54:58 -05:00
|
|
|
cd dist/$(TARBALL_PREFIX)/ipa-client; ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); make distclean
|
2009-02-03 15:56:41 -06:00
|
|
|
cd dist/$(TARBALL_PREFIX)/daemons; ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); make distclean
|
|
|
|
cd dist/$(TARBALL_PREFIX)/install; ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); make distclean
|
2009-02-02 12:50:53 -06:00
|
|
|
cd dist; tar cfz sources/$(TARBALL) $(TARBALL_PREFIX)
|
|
|
|
rm -rf dist/$(TARBALL_PREFIX)
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2007-08-15 12:09:01 -05:00
|
|
|
rpmroot:
|
2011-12-09 03:00:27 -06:00
|
|
|
rm -rf $(RPMBUILD)
|
2007-08-15 12:09:01 -05:00
|
|
|
mkdir -p $(RPMBUILD)/BUILD
|
|
|
|
mkdir -p $(RPMBUILD)/RPMS
|
|
|
|
mkdir -p $(RPMBUILD)/SOURCES
|
|
|
|
mkdir -p $(RPMBUILD)/SPECS
|
|
|
|
mkdir -p $(RPMBUILD)/SRPMS
|
|
|
|
|
2008-02-21 09:23:29 -06:00
|
|
|
rpmdistdir:
|
|
|
|
mkdir -p dist/rpms
|
|
|
|
mkdir -p dist/srpms
|
|
|
|
|
2011-04-28 11:14:43 -05:00
|
|
|
rpms: rpmroot rpmdistdir version-update lint tarballs
|
2009-02-02 12:50:53 -06:00
|
|
|
cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/.
|
2011-01-17 03:26:19 -06:00
|
|
|
rpmbuild --define "_topdir $(RPMBUILD)" -ba freeipa.spec
|
2011-12-07 18:04:55 -06:00
|
|
|
cp $(RPMBUILD)/RPMS/*/$(PRJ_PREFIX)-*-$(IPA_VERSION)-*.rpm dist/rpms/
|
|
|
|
cp $(RPMBUILD)/SRPMS/$(PRJ_PREFIX)-$(IPA_VERSION)-*.src.rpm dist/srpms/
|
|
|
|
rm -rf $(RPMBUILD)
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2011-04-28 11:14:43 -05:00
|
|
|
client-rpms: rpmroot rpmdistdir version-update lint tarballs
|
2009-10-12 15:00:00 -05:00
|
|
|
cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/.
|
2011-01-17 03:26:19 -06:00
|
|
|
rpmbuild --define "_topdir $(RPMBUILD)" --define "ONLY_CLIENT 1" -ba freeipa.spec
|
2011-12-07 18:04:55 -06:00
|
|
|
cp $(RPMBUILD)/RPMS/*/$(PRJ_PREFIX)-*-$(IPA_VERSION)-*.rpm dist/rpms/
|
|
|
|
cp $(RPMBUILD)/SRPMS/$(PRJ_PREFIX)-$(IPA_VERSION)-*.src.rpm dist/srpms/
|
|
|
|
rm -rf $(RPMBUILD)
|
2009-10-12 15:00:00 -05:00
|
|
|
|
2011-04-28 11:14:43 -05:00
|
|
|
srpms: rpmroot rpmdistdir version-update lint tarballs
|
2009-05-07 16:37:29 -05:00
|
|
|
cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/.
|
2011-01-17 03:26:19 -06:00
|
|
|
rpmbuild --define "_topdir $(RPMBUILD)" -bs freeipa.spec
|
2011-12-07 18:04:55 -06:00
|
|
|
cp $(RPMBUILD)/SRPMS/$(PRJ_PREFIX)-$(IPA_VERSION)-*.src.rpm dist/srpms/
|
|
|
|
rm -rf $(RPMBUILD)
|
2009-05-07 16:37:29 -05:00
|
|
|
|
|
|
|
|
2008-02-21 09:23:29 -06:00
|
|
|
repodata:
|
|
|
|
-createrepo -p dist
|
|
|
|
|
|
|
|
dist: version-update archive tarballs archive-cleanup rpms repodata
|
0000-12-31 18:09:24 -05:50
|
|
|
|
2009-02-03 15:56:41 -06:00
|
|
|
local-dist: bootstrap-autogen clean local-archive tarballs archive-cleanup rpms
|
0000-12-31 18:09:24 -05:50
|
|
|
|
|
|
|
|
2008-08-08 08:35:05 -05:00
|
|
|
clean: version-update
|
0000-12-31 18:09:24 -05:50
|
|
|
@for subdir in $(SUBDIRS); do \
|
|
|
|
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
|
|
|
done
|
|
|
|
rm -f *~
|
|
|
|
|
2008-08-08 08:35:05 -05:00
|
|
|
distclean: version-update
|
2009-10-12 15:00:00 -05:00
|
|
|
touch daemons/NEWS daemons/README daemons/AUTHORS daemons/ChangeLog
|
|
|
|
touch install/NEWS install/README install/AUTHORS install/ChangeLog
|
0000-12-31 18:09:24 -05:50
|
|
|
@for subdir in $(SUBDIRS); do \
|
|
|
|
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
|
|
|
done
|
2011-12-07 18:04:55 -06:00
|
|
|
rm -fr $(RPMBUILD) dist build
|
2009-10-12 15:00:00 -05:00
|
|
|
rm -f daemons/NEWS daemons/README daemons/AUTHORS daemons/ChangeLog
|
|
|
|
rm -f install/NEWS install/README install/AUTHORS install/ChangeLog
|
0000-12-31 18:09:24 -05:50
|
|
|
|
0000-12-31 18:09:24 -05:50
|
|
|
maintainer-clean: clean
|
2011-12-07 18:04:55 -06:00
|
|
|
rm -fr $(RPMBUILD) dist build
|
2009-02-02 12:50:53 -06:00
|
|
|
cd selinux && $(MAKE) maintainer-clean
|
|
|
|
cd daemons && $(MAKE) maintainer-clean
|
|
|
|
cd install && $(MAKE) maintainer-clean
|
0000-12-31 18:09:24 -05:50
|
|
|
cd ipa-client && $(MAKE) maintainer-clean
|
2009-02-05 14:03:08 -06:00
|
|
|
cd ipapython && $(MAKE) maintainer-clean
|
2009-02-02 12:50:53 -06:00
|
|
|
rm -f version.m4
|
2011-01-17 03:26:19 -06:00
|
|
|
rm -f freeipa.spec
|