Skip to content

Commit

Permalink
Split ipa-client/ into ipaclient/ (Python library) and client/ (C, sc…
Browse files Browse the repository at this point in the history
…ripts)

Make ipaclient a Python library like ipapython, ipalib, etc.
Use setup.py instead of autotools for installing it.

Move C client tools, Python scripts, and man pages, to client/.

Remove old, empty or outdated, boilerplate files (NEWS, README, AUTHORS).
Remove /setup-client.py (ipalib/setup.py should be used instead).

Update Makefiles and the spec file accordingly.

https://fedorahosted.org/freeipa/ticket/5638

Reviewed-By: Jan Cholasta <[email protected]>
  • Loading branch information
encukou authored and Jan Cholasta committed Jan 27, 2016
1 parent 7dae5c0 commit 840de9b
Show file tree
Hide file tree
Showing 38 changed files with 111 additions and 235 deletions.
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ freeipa2-dev-doc
/install/ui/src/plugins
!/install/ui/doc/Makefile

/ipa-client/ipa-client.spec
/ipa-client/ipa-getkeytab
/ipa-client/ipa-join
/ipa-client/ipa-rmkeytab
/client/ipa-getkeytab
/client/ipa-join
/client/ipa-rmkeytab

/ipatests/setup.py

/ipaclient/setup.py

/ipalib/setup.py
!/ipalib/Makefile

Expand Down
39 changes: 21 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

include VERSION

SUBDIRS=asn1 daemons install ipapython ipalib ipa-client
CLIENTDIRS=ipapython ipa-client asn1
SUBDIRS=asn1 daemons install ipapython ipalib
CLIENTDIRS=ipapython client asn1
CLIENTPYDIRS=ipaclient ipaplatform

PRJ_PREFIX=freeipa

Expand Down Expand Up @@ -75,7 +76,9 @@ client: client-autogen
@for subdir in $(CLIENTDIRS); do \
(cd $$subdir && $(MAKE) all) || exit 1; \
done
cd ipaplatform && $(PYTHON) setup.py build
@for subdir in $(CLIENTPYDIRS); do \
(cd $$subdir && $(PYTHON) setup.py build); \
done

check: bootstrap-autogen server tests
@for subdir in $(SUBDIRS); do \
Expand All @@ -90,13 +93,13 @@ bootstrap-autogen: version-update client-autogen

client-autogen: version-update
cd asn1; if [ ! -e Makefile ]; then ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); fi
cd ipa-client; if [ ! -e Makefile ]; then ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); fi
cd client; if [ ! -e Makefile ]; then ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); fi
cd install; if [ ! -e Makefile ]; then ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); fi

tests-man-autogen: version-update
cd ipatests/man; if [ ! -e Makefile ]; then ../../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); fi

install: all server-install tests-install
install: all server-install tests-install client-install
@for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) $@) || exit 1; \
done
Expand All @@ -106,13 +109,13 @@ client-install: client client-dirs
(cd $$subdir && $(MAKE) install) || exit 1; \
done
cd install/po && $(MAKE) install || exit 1;
if [ "$(DESTDIR)" = "" ]; then \
$(PYTHON) setup-client.py install; \
(cd ipaplatform && $(PYTHON) setup.py install); \
else \
$(PYTHON) setup-client.py install --root $(DESTDIR); \
(cd ipaplatform && $(PYTHON) setup.py install --root $(DESTDIR)); \
fi
@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 \
Expand Down Expand Up @@ -149,6 +152,8 @@ version-update: release-update
> ipapython/version.py
sed -e s/__VERSION__/$(IPA_VERSION)/ ipatests/setup.py.in \
> ipatests/setup.py
sed -e s/__VERSION__/$(IPA_VERSION)/ ipaclient/setup.py.in \
> ipaclient/setup.py
sed -e s/__NUM_VERSION__/$(IPA_NUM_VERSION)/ install/ui/src/libs/loader.js.in \
> install/ui/src/libs/loader.js
perl -pi -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" install/ui/src/libs/loader.js
Expand All @@ -161,10 +166,8 @@ version-update: release-update
perl -pi -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" daemons/ipa-version.h
perl -pi -e "s:__DATA_VERSION__:$(IPA_DATA_VERSION):" daemons/ipa-version.h

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
sed -e s/__VERSION__/$(IPA_VERSION)/ client/version.m4.in \
> client/version.m4

if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
sed -e s/__PLATFORM__/$(SUPPORTED_PLATFORM)/ \
Expand Down Expand Up @@ -220,7 +223,7 @@ archive-cleanup:
tarballs: local-archive
-mkdir -p dist/sources
# tar up clean sources
cd dist/$(TARBALL_PREFIX)/ipa-client; ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); make distclean
cd dist/$(TARBALL_PREFIX)/client; ../autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=$(LIBDIR); make distclean
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
cd dist; tar cfz sources/$(TARBALL) $(TARBALL_PREFIX)
Expand Down Expand Up @@ -289,7 +292,7 @@ maintainer-clean: clean
rm -fr $(RPMBUILD) dist build
cd daemons && $(MAKE) maintainer-clean
cd install && $(MAKE) maintainer-clean
cd ipa-client && $(MAKE) maintainer-clean
cd client && $(MAKE) maintainer-clean
cd ipapython && $(MAKE) maintainer-clean
rm -f version.m4
rm -f freeipa.spec
18 changes: 7 additions & 11 deletions ipa-client/Makefile.am → client/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ sbin_PROGRAMS = \
ipa-join \
$(NULL)

sbin_SCRIPTS = \
ipa-client-install \
ipa-client-automount \
ipa-certupdate \
$(NULL)

ipa_getkeytab_SOURCES = \
ipa-getkeytab.c \
ipa-client-common.c \
Expand Down Expand Up @@ -88,19 +94,11 @@ ipa_join_LDADD = \

SUBDIRS = \
../asn1 \
ipaclient \
ipa-install \
man \
$(NULL)

EXTRA_DIST = \
ipa-client.spec \
COPYING \
AUTHORS \
INSTALL \
README \
HACKING \
NEWS \
$(sbin_SCRIPTS) \
$(NULL)

DISTCLEANFILES = \
Expand All @@ -124,7 +122,5 @@ MAINTAINERCLEANFILES = \
config.h.* \
aclocal.m4 \
version.m4 \
ipa-client.spec \
py-compile \
$(NULL)

File renamed without changes.
15 changes: 0 additions & 15 deletions ipa-client/configure.ac → client/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ AC_INIT([ipa-client],
LT_INIT()
AC_PROG_LIBTOOL

AC_CONFIG_SRCDIR([ipaclient/__init__.py])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SUBDIRS([../asn1])

Expand Down Expand Up @@ -140,18 +139,6 @@ AC_CHECK_HEADER(sasl/sasl.h, [], [AC_MSG_ERROR([sasl/sasl.h not found])])
AC_CHECK_LIB(sasl2, sasl_client_init, [SASL_LIBS="-lsasl2"])
AC_SUBST(SASL_LIBS)

dnl ---------------------------------------------------------------------------
dnl - Check for Python
dnl ---------------------------------------------------------------------------

AC_MSG_NOTICE([Checking for Python])
have_python=no
AM_PATH_PYTHON(2.3)

if test "x$PYTHON" = "x" ; then
AC_MSG_ERROR([Python not found])
fi

dnl ---------------------------------------------------------------------------
dnl - Check for CURL
dnl ---------------------------------------------------------------------------
Expand Down Expand Up @@ -235,8 +222,6 @@ dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES([
Makefile
../asn1/Makefile
ipaclient/Makefile
ipa-install/Makefile
man/Makefile
])

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion freeipa.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ rm -f ipaplatform/tasks.py
rm -f ipaplatform/paths.py
rm -f ipaplatform/constants.py
make version-update
cd ipa-client; ../autogen.sh --prefix=%{_usr} --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --mandir=%{_mandir}; cd ..
cd client; ../autogen.sh --prefix=%{_usr} --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --mandir=%{_mandir}; cd ..
%if ! %{ONLY_CLIENT}
cd daemons; ../autogen.sh --prefix=%{_usr} --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --mandir=%{_mandir} --with-openldap; cd ..
cd install; ../autogen.sh --prefix=%{_usr} --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --mandir=%{_mandir}; cd ..
Expand Down Expand Up @@ -1253,6 +1253,7 @@ fi
%license COPYING
%dir %{python_sitelib}/ipaclient
%{python_sitelib}/ipaclient/*.py*
%{python_sitelib}/ipaclient-*.egg-info


%files client-common
Expand Down
8 changes: 5 additions & 3 deletions install/po/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ po_files = $(patsubst %, %.po, $(languages))
mo_files = $(patsubst %.po, %.mo, $(po_files))
po_count=$(words $(po_files))

PY_FILES = $(shell cd ../..; git ls-files | grep -v -e "^ipatests/" -e "^doc/" -e "^install/po/" -e "^ipapython/test/" -e "setup.py" -e "setup-client.py" | grep "\.py$$" | tr '\n' ' '; cd install/po)
PY_FILES = $(shell cd ../..; git ls-files | grep -v -e "^ipatests/" -e "^doc/" -e "^install/po/" -e "^ipapython/test/" -e "setup.py" | grep "\.py$$" | tr '\n' ' '; cd install/po)
C_FILES = $(shell cd ../..; git ls-files | grep "\.c$$" | tr '\n' ' '; cd install/po)
H_FILES = $(shell cd ../..; git ls-files | grep "\.h$$" | tr '\n' ' '; cd install/po)

# Please keep this list sorted!
PY_EXPLICIT_FILES = \
client/ipa-client-install \
client/ipa-client-automount \
client/ipa-certupdate \
install/tools/ipa-adtrust-install \
install/tools/ipa-advise \
install/tools/ipa-backup \
Expand All @@ -64,8 +67,7 @@ PY_EXPLICIT_FILES = \
install/tools/ipa-server-install \
install/tools/ipa-server-upgrade \
install/tools/ipa-upgradeconfig \
ipa \
ipa-client/ipa-install/ipa-client-install
ipa


PYTHON_POTFILES = $(PY_FILES) $(PY_EXPLICIT_FILES)
Expand Down
Empty file removed ipa-client/AUTHORS
Empty file.
Empty file removed ipa-client/NEWS
Empty file.
24 changes: 0 additions & 24 deletions ipa-client/README

This file was deleted.

86 changes: 0 additions & 86 deletions ipa-client/ipa-client.spec.in

This file was deleted.

15 changes: 0 additions & 15 deletions ipa-client/ipa-install/Makefile.am

This file was deleted.

17 changes: 0 additions & 17 deletions ipa-client/ipaclient/Makefile.am

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 840de9b

Please sign in to comment.