From 0a17155e5b0434d4cab4d1696fac7f5ef88f0808 Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Tue, 25 Oct 2016 12:34:29 +0200 Subject: Build: replace hand-made Makefile with one generated by Automake The neither build nor dist targets work completely. This is temporary breakage enabling further work. https://fedorahosted.org/freeipa/ticket/6418 Reviewed-By: Martin Basti Reviewed-By: Christian Heimes --- .gitignore | 2 +- Makefile | 255 -------------------------------------------------------- Makefile.am | 5 ++ configure.ac | 1 + freeipa.spec.in | 20 +---- 5 files changed, 10 insertions(+), 273 deletions(-) delete mode 100644 Makefile create mode 100644 Makefile.am diff --git a/.gitignore b/.gitignore index ac69f97bf..8ba75d488 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ stamp-h1 libtool build/ compile +test-driver # Python compilation *.pyc @@ -37,7 +38,6 @@ freeipa2-dev-doc # Root directory /freeipa.spec -!/Makefile /dist/ /*/dist/ /RELEASE diff --git a/Makefile b/Makefile deleted file mode 100644 index 691f7532a..000000000 --- a/Makefile +++ /dev/null @@ -1,255 +0,0 @@ -# IPA build system cannot cope with parallel build; disable parallel build -.NOTPARALLEL: - -SUBDIRS=util asn1 daemons install ipapython ipalib -CLIENTDIRS=ipapython ipalib client util asn1 -CLIENTPYDIRS=ipaclient ipaplatform -PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipaserver ipatests - -PRJ_PREFIX=freeipa - -RPMBUILD ?= $(PWD)/rpmbuild -TARGET ?= master - -# temporary hack until we replace hand-made Makefile with the generated one -IPA_VERSION=4.4.90 -TARBALL_PREFIX=freeipa-$(IPA_VERSION) -TARBALL=$(TARBALL_PREFIX).tar.gz - -LIBDIR ?= /usr/lib - -DEVELOPER_MODE ?= 0 -ifneq ($(DEVELOPER_MODE),0) -LINT_IGNORE_FAIL=true -else -LINT_IGNORE_FAIL=false -endif - -PYTHON ?= $(shell rpm -E %__python || echo /usr/bin/python2) - -CFLAGS := -g -O2 -Wall -Wextra -Wformat-security -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers $(CFLAGS) -export CFLAGS - -# Uncomment to increase Java stack size for Web UI build in case it fails -# because of stack overflow exception. Default should be OK for most platforms. -#JAVA_STACK_SIZE ?= 8m -#export JAVA_STACK_SIZE - -all: bootstrap-autogen server tests - @for subdir in $(SUBDIRS); do \ - (cd $$subdir && $(MAKE) $@) || exit 1; \ - done - -# empty target to force executation -.PHONY=FORCE -FORCE: - -client: bootstrap-autogen egg_info - @for subdir in $(CLIENTDIRS); do \ - (cd $$subdir && $(MAKE) all) || exit 1; \ - done - @for subdir in $(CLIENTPYDIRS); do \ - (cd $$subdir && $(PYTHON) setup.py build); \ - done - -check: bootstrap-autogen server tests - @for subdir in $(SUBDIRS); do \ - (cd $$subdir && $(MAKE) check) || exit 1; \ - done - -client-check: bootstrap-autogen - @for subdir in $(CLIENTDIRS); do \ - (cd $$subdir && $(MAKE) check) || exit 1; \ - done - -bootstrap-autogen: version-update - @echo "Building IPA $(IPA_VERSION)" - ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR) - -install: all server-install tests-install client-install - @for subdir in $(SUBDIRS); do \ - (cd $$subdir && $(MAKE) $@) || exit 1; \ - done - -client-install: client client-dirs - @for subdir in $(CLIENTDIRS); do \ - (cd $$subdir && $(MAKE) install) || exit 1; \ - done - cd po && $(MAKE) install || exit 1; - @for subdir in $(CLIENTPYDIRS); do \ - if [ "$(DESTDIR)" = "" ]; then \ - (cd $$subdir && $(PYTHON) setup.py install); \ - else \ - (cd $$subdir && $(PYTHON) setup.py install --root $(DESTDIR)); \ - fi \ - done - -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 - -pylint: bootstrap-autogen - # find all python modules and executable python files outside modules for pylint check - FILES=`find . \ - -type d -exec test -e '{}/__init__.py' \; -print -prune -o \ - -path '*/.*' -o \ - -path './dist/*' -o \ - -path './lextab.py' -o \ - -path './yacctab.py' -o \ - -name '*~' -o \ - -name \*.py -print -o \ - -type f -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \ - echo "Pylint is running, please wait ..."; \ - PYTHONPATH=. pylint --rcfile=pylintrc $(PYLINTFLAGS) $$FILES || $(LINT_IGNORE_FAIL) - -po-validate: - $(MAKE) -C po validate-src-strings || $(LINT_IGNORE_FAIL) - -jslint: - cd install/ui; jsl -nologo -nosummary -nofilelisting -conf jsl.conf || $(LINT_IGNORE_FAIL) - -lint: apilint acilint pylint po-validate jslint - -test: - ./make-test - -ipapython/version.py: API.txt bootstrap-autogen - grep -Po '(?<=default: ).*' API.txt | sed -n -i -e "/__DEFAULT_PLUGINS__/!{p;b};r /dev/stdin" $@ - touch -r $< $@ - -.PHONY: egg_info -egg_info: ipapython/version.py ipaplatform/__init__.py - for directory in $(PYPKGDIRS); do \ - pushd $${directory} ; \ - $(PYTHON) setup.py egg_info $(EXTRA_SETUP); \ - popd ; \ - done - -version-update: ipapython/version.py - -apilint: bootstrap-autogen - ./makeapi --validate - -acilint: bootstrap-autogen - ./makeaci --validate - -server: version-update bootstrap-autogen egg_info - cd ipaserver && $(PYTHON) setup.py build - cd ipaplatform && $(PYTHON) setup.py build - -server-install: server - if [ "$(DESTDIR)" = "" ]; then \ - (cd ipaserver && $(PYTHON) setup.py install) || exit 1; \ - (cd ipaplatform && $(PYTHON) setup.py install) || exit 1; \ - else \ - (cd ipaserver && $(PYTHON) setup.py install --root $(DESTDIR)) || exit 1; \ - (cd ipaplatform && $(PYTHON) setup.py install --root $(DESTDIR)) || exit 1; \ - fi - -tests: version-update bootstrap-autogen egg_info - cd ipatests; $(PYTHON) setup.py build - cd ipatests/man && $(MAKE) all - -tests-install: tests - if [ "$(DESTDIR)" = "" ]; then \ - cd ipatests; $(PYTHON) setup.py install; \ - else \ - cd ipatests; $(PYTHON) setup.py install --root $(DESTDIR); \ - fi - cd ipatests/man && $(MAKE) install - -archive: - -mkdir -p dist - git archive --format=tar --prefix=ipa/ $(TARGET) | (cd dist && tar xf -) - -local-archive: - -mkdir -p dist/$(TARBALL_PREFIX) - rsync -a --exclude=dist --exclude=.git --exclude=/build --exclude=rpmbuild . dist/$(TARBALL_PREFIX) - -archive-cleanup: - rm -fr dist/freeipa - -tarballs: local-archive - -mkdir -p dist/sources - # tar up clean sources - cd dist/$(TARBALL_PREFIX); ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR) - cd dist/$(TARBALL_PREFIX)/asn1; make distclean - cd dist/$(TARBALL_PREFIX)/daemons; make distclean - cd dist/$(TARBALL_PREFIX)/client; make distclean - cd dist/$(TARBALL_PREFIX)/install; make distclean - cd dist; tar cfz sources/$(TARBALL) $(TARBALL_PREFIX) - rm -rf dist/$(TARBALL_PREFIX) - -rpmroot: - rm -rf $(RPMBUILD) - mkdir -p $(RPMBUILD)/BUILD - mkdir -p $(RPMBUILD)/RPMS - mkdir -p $(RPMBUILD)/SOURCES - mkdir -p $(RPMBUILD)/SPECS - mkdir -p $(RPMBUILD)/SRPMS - -rpmdistdir: - mkdir -p dist/rpms - mkdir -p dist/srpms - -rpms: rpmroot rpmdistdir version-update lint tarballs - cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/. - rpmbuild --define "_topdir $(RPMBUILD)" -ba freeipa.spec - cp $(RPMBUILD)/RPMS/*/$(PRJ_PREFIX)-*-$(IPA_VERSION)-*.rpm dist/rpms/ - cp $(RPMBUILD)/RPMS/*/python?-ipa*-$(IPA_VERSION)-*.rpm dist/rpms/ - cp $(RPMBUILD)/SRPMS/$(PRJ_PREFIX)-$(IPA_VERSION)-*.src.rpm dist/srpms/ - rm -rf $(RPMBUILD) - -client-rpms: rpmroot rpmdistdir version-update lint tarballs - cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/. - rpmbuild --define "_topdir $(RPMBUILD)" --define "ONLY_CLIENT 1" -ba freeipa.spec - cp $(RPMBUILD)/RPMS/*/$(PRJ_PREFIX)-*-$(IPA_VERSION)-*.rpm dist/rpms/ - cp $(RPMBUILD)/RPMS/*/python?-ipa*-$(IPA_VERSION)-*.rpm dist/rpms/ - cp $(RPMBUILD)/SRPMS/$(PRJ_PREFIX)-$(IPA_VERSION)-*.src.rpm dist/srpms/ - rm -rf $(RPMBUILD) - -srpms: rpmroot rpmdistdir version-update lint tarballs - cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES/. - rpmbuild --define "_topdir $(RPMBUILD)" -bs freeipa.spec - cp $(RPMBUILD)/SRPMS/$(PRJ_PREFIX)-$(IPA_VERSION)-*.src.rpm dist/srpms/ - rm -rf $(RPMBUILD) - - -repodata: - -createrepo -p dist - -dist: version-update archive tarballs archive-cleanup rpms repodata - -local-dist: bootstrap-autogen clean local-archive tarballs archive-cleanup rpms - - -clean: version-update - @for subdir in $(SUBDIRS); do \ - (cd $$subdir && $(MAKE) $@) || exit 1; \ - done - rm -rf ipasetup.py ipasetup.py? - rm -f *~ - -distclean: version-update - touch NEWS AUTHORS ChangeLog - touch install/NEWS install/README install/AUTHORS install/ChangeLog - @for subdir in $(SUBDIRS); do \ - (cd $$subdir && $(MAKE) $@) || exit 1; \ - done - rm -fr $(RPMBUILD) dist build - rm -f NEWS AUTHORS ChangeLog - rm -f install/NEWS install/README install/AUTHORS install/ChangeLog - -maintainer-clean: clean - rm -fr $(RPMBUILD) dist build - cd daemons && $(MAKE) maintainer-clean - cd install && $(MAKE) maintainer-clean - cd client && $(MAKE) maintainer-clean - cd ipapython && $(MAKE) maintainer-clean - rm -f version.m4 - rm -f freeipa.spec diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 000000000..1e6b47519 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = asn1 util client daemons install ipaclient ipalib ipaplatform ipapython ipaserver ipatests po +# checks +# contrib +# doc +# init diff --git a/configure.ac b/configure.ac index 6464d196a..6873f5657 100644 --- a/configure.ac +++ b/configure.ac @@ -408,6 +408,7 @@ AC_CONFIG_LINKS([ipaplatform/__init__.py:ipaplatform/$IPAPLATFORM/__init__.py ]) AC_CONFIG_FILES([ + Makefile asn1/Makefile asn1/asn1c/Makefile client/Makefile diff --git a/freeipa.spec.in b/freeipa.spec.in index 9e30a3927..7a093c3e9 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -685,15 +685,8 @@ This package contains tests that verify IPA functionality under Python 3. %build # UI compilation segfaulted on some arches when the stack was lower (#1040576) export JAVA_STACK_SIZE="8m" - -export CFLAGS="%{optflags} $CFLAGS" -export LDFLAGS="%{__global_ldflags} $LDFLAGS" - -%if ! %{ONLY_CLIENT} -make IPA_VERSION_IS_GIT_SNAPSHOT=no LIBDIR=%{_libdir} %{?_smp_mflags} all -%else -make IPA_VERSION_IS_GIT_SNAPSHOT=no LIBDIR=%{_libdir} %{?_smp_mflags} client -%endif # ONLY_CLIENT +%configure +%make_build %check @@ -705,10 +698,7 @@ make %{?_smp_mflags} client-check VERBOSE=yes LIBDIR=%{_libdir} %install -rm -rf %{buildroot} -make version-update LIBDIR=%{_libdir} -%if ! %{ONLY_CLIENT} -make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} +%make_install mv %{buildroot}%{_bindir}/ipa-run-tests %{buildroot}%{_bindir}/ipa-run-tests-%{python2_version} mv %{buildroot}%{_bindir}/ipa-test-config %{buildroot}%{_bindir}/ipa-test-config-%{python2_version} @@ -731,10 +721,6 @@ ln -s %{_bindir}/ipa-run-tests-%{python2_version} %{buildroot}%{_bindir}/ipa-run ln -s %{_bindir}/ipa-test-config-%{python2_version} %{buildroot}%{_bindir}/ipa-test-config ln -s %{_bindir}/ipa-test-task-%{python2_version} %{buildroot}%{_bindir}/ipa-test-task -%else -make client-install DESTDIR=%{buildroot} LIBDIR=%{_libdir} -%endif # ONLY_CLIENT - %if 0%{?with_python3} (cd ipalib && make PYTHON=%{__python3} IPA_VERSION_IS_GIT_SNAPSHOT=no %{?_smp_mflags} DESTDIR=%{buildroot} LIBDIR=%{_libdir} install) (cd ipapython && make PYTHON=%{__python3} IPA_VERSION_IS_GIT_SNAPSHOT=no %{?_smp_mflags} DESTDIR=%{buildroot} LIBDIR=%{_libdir} install) -- cgit