summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--ipa-server/Makefile7
-rw-r--r--ipa-server/Makefile.common21
-rwxr-xr-xipa-server/freeipa-server.spec4
-rw-r--r--ipa-server/freeipa-server.spec.in4
-rw-r--r--ipa-server/ipa-gui/Makefile7
-rw-r--r--ipa-server/ipa-install/Makefile11
-rw-r--r--ipa-server/ipa-install/ipa-server-install12
-rw-r--r--ipa-server/ipa-install/share/Makefile9
-rw-r--r--ipa-server/ipa-kpasswd/Makefile10
-rw-r--r--ipa-server/ipa-slapi-plugins/dna/Makefile15
-rw-r--r--ipa-server/ipa-slapi-plugins/ipa-memberof/Makefile15
-rw-r--r--ipa-server/ipa-slapi-plugins/ipa-pwd-extop/Makefile15
-rw-r--r--ipa-server/ipaserver/dsinstance.py6
-rw-r--r--ipa-server/ipaserver/krbinstance.py4
-rw-r--r--ipa-server/xmlrpc-server/Makefile10
16 files changed, 72 insertions, 87 deletions
diff --git a/Makefile b/Makefile
index f15c9dea..dc2a4837 100644
--- a/Makefile
+++ b/Makefile
@@ -4,9 +4,6 @@ PRJ_PREFIX=freeipa
RPMBUILD ?= $(PWD)/rpmbuild
-# set to 1 to produce a debug build of all subprojects
-#DEBUG=1
-
# Version numbers - this is for the entire server. After
# updating this you should run the version-update
# target.
@@ -38,12 +35,6 @@ CLI_VERSION=$(CLI_MAJOR).$(CLI_MINOR).$(CLI_RELEASE)
CLI_TARBALL_PREFIX=$(PRJ_PREFIX)-client-$(CLI_VERSION)
CLI_TARBALL=$(CLI_TARBALL_PREFIX).tgz
-ifeq ($(DEBUG),1)
- export CFLAGS = -g -Wall -Wshadow
- export LDFLAGS = -g
-endif
-
-
all:
@for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) $@) || exit 1; \
diff --git a/ipa-server/Makefile b/ipa-server/Makefile
index 4b1fe14b..dacba848 100644
--- a/ipa-server/Makefile
+++ b/ipa-server/Makefile
@@ -1,9 +1,6 @@
-SUBDIRS=ipa-install xmlrpc-server ipa-kpasswd ipa-slapi-plugins ipa-gui
-
-SHAREDIR=$(DESTDIR)/usr/share/ipa
-PYTHONDIR=$(SHAREDIR)/ipaserver
-SBINDIR=$(DESTDIR)/usr/sbin
+include Makefile.common
+SUBDIRS=ipa-install xmlrpc-server ipa-kpasswd ipa-slapi-plugins ipa-gui
all:
@for subdir in $(SUBDIRS); do \
diff --git a/ipa-server/Makefile.common b/ipa-server/Makefile.common
new file mode 100644
index 00000000..0ca3e213
--- /dev/null
+++ b/ipa-server/Makefile.common
@@ -0,0 +1,21 @@
+# set to 1 to produce a debug build of all subprojects
+#export DEBUG=1
+
+# set to 1 to build for 64bit
+#export BUILD64=0
+
+ifeq ($(DEBUG),1)
+ export CFLAGS = -g -Wall -Wshadow
+ export LDFLAGS = -g
+else
+ export CFLAGS = -O2 -Wall -Wshadow
+endif
+
+DIRSRV=dirsrv
+PREFIX?=$(DESTDIR)/usr
+LIBDIR?=$(DESTDIR)/usr/lib
+SHAREDIR?=$(PREFIX)/share/ipa
+PLUGINDIR?=$(LIBDIR)/$(DIRSRV)/plugins
+SBINDIR?=$(PREFIX)/sbin
+INITDIR?=$(DESTDIR)/etc/rc.d/init.d
+PYTHONDIR?=$(SHAREDIR)/ipaserver \ No newline at end of file
diff --git a/ipa-server/freeipa-server.spec b/ipa-server/freeipa-server.spec
index 2cfd3274..0519c819 100755
--- a/ipa-server/freeipa-server.spec
+++ b/ipa-server/freeipa-server.spec
@@ -14,7 +14,7 @@ BuildRequires: fedora-ds-base-devel openldap-devel krb5-devel nss-devel mozldap-
Requires: python fedora-ds-base krb5-server krb5-server-ldap nss-tools openldap-clients httpd mod_python mod_auth_kerb python-ldap freeipa-python ntp cyrus-sasl-gssapi nss TurboGears
%define httpd_conf /etc/httpd/conf.d
-%define plugin_dir /usr/lib/dirsrv/plugins
+%define plugin_dir %{_libdir}/dirsrv/plugins
%description
FreeIPA is a server for identity, policy, and audit.
@@ -31,7 +31,7 @@ rm -rf %{buildroot}
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{plugin_dir}
-make install DESTDIR=%{buildroot}
+make install DESTDIR=%{buildroot} LIBDIR=%{buildroot}%{_libdir}
%clean
diff --git a/ipa-server/freeipa-server.spec.in b/ipa-server/freeipa-server.spec.in
index dbae4fed..914a7c05 100644
--- a/ipa-server/freeipa-server.spec.in
+++ b/ipa-server/freeipa-server.spec.in
@@ -14,7 +14,7 @@ BuildRequires: fedora-ds-base-devel openldap-devel krb5-devel nss-devel mozldap-
Requires: python fedora-ds-base krb5-server krb5-server-ldap nss-tools openldap-clients httpd mod_python mod_auth_kerb python-ldap freeipa-python ntp cyrus-sasl-gssapi nss TurboGears
%define httpd_conf /etc/httpd/conf.d
-%define plugin_dir /usr/lib/dirsrv/plugins
+%define plugin_dir %{_libdir}/dirsrv/plugins
%description
FreeIPA is a server for identity, policy, and audit.
@@ -31,7 +31,7 @@ rm -rf %{buildroot}
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{plugin_dir}
-make install DESTDIR=%{buildroot}
+make install DESTDIR=%{buildroot} LIBDIR=%{buildroot}%{_libdir}
%clean
diff --git a/ipa-server/ipa-gui/Makefile b/ipa-server/ipa-gui/Makefile
index ba641d28..26ee7d31 100644
--- a/ipa-server/ipa-gui/Makefile
+++ b/ipa-server/ipa-gui/Makefile
@@ -1,8 +1,6 @@
-SHAREDIR=$(DESTDIR)/usr/share/ipa
-SBINDIR=$(DESTDIR)/usr/sbin
-INITDIR = $(DESTDIR)/etc/rc.d/init.d
+include ../Makefile.common
-IPAGUI_SUBDIRS=config forms helpers templates
+IPAGUI_SUBDIRS=config forms helpers templates subcontrollers
STATIC_SUBDIRS=css images javascript
all: ;
@@ -20,6 +18,7 @@ install:
done
install -m 644 ipagui/config/*.cfg $(SHAREDIR)/ipagui/config
+ install -m 644 ipagui/templates/*.kid $(SHAREDIR)/ipagui/templates
-mkdir -p $(SHAREDIR)/ipagui/static
@for subdir in $(STATIC_SUBDIRS); do \
diff --git a/ipa-server/ipa-install/Makefile b/ipa-server/ipa-install/Makefile
index 40a39b57..46be2c72 100644
--- a/ipa-server/ipa-install/Makefile
+++ b/ipa-server/ipa-install/Makefile
@@ -1,5 +1,4 @@
-SHAREDIR=$(DESTDIR)/usr/share/ipa
-SBINDIR=$(DESTDIR)/usr/sbin
+include ../Makefile.common
all: ;
@@ -7,9 +6,13 @@ install:
-mkdir $(SBINDIR)
install -m 755 ipa-server-install $(SBINDIR)
install -m 755 ipa-server-setupssl $(SHAREDIR)
- $(MAKE) -C share $@
+
+ -mkdir -p $(SHAREDIR)
+ install -m 644 share/*.ldif $(SHAREDIR)
+ install -m 644 share/*.template $(SHAREDIR)
+
$(MAKE) -C test $@
clean:
- $(MAKE) -C share $@
rm -f *~ *.pyc
+ rm -f share/*~
diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install
index 462774ba..34666af5 100644
--- a/ipa-server/ipa-install/ipa-server-install
+++ b/ipa-server/ipa-install/ipa-server-install
@@ -128,10 +128,15 @@ def check_existing_installation():
yesno = raw_input("Do you wish to remove it and create a new one? [no]: ")
if not yesno or yesno.lower()[0] != "y":
sys.exit(1)
+
+ try:
+ run(["/sbin/service", "dirsrv", "stop"])
+ except:
+ pass
for d in dirs:
serverid = os.path.basename(d).split("slapd-", 1)[1]
if serverid:
- erase_ds_instance_data (serverid)
+ erase_ds_instance_data(serverid)
def get_fqdn():
fqdn = ""
@@ -531,4 +536,7 @@ def main():
return 0
-main()
+try:
+ main()
+except Exception, e:
+ print "Unexpected error - see ipaserver-install.log for details:\n %s" % str(e)
diff --git a/ipa-server/ipa-install/share/Makefile b/ipa-server/ipa-install/share/Makefile
index 380480bc..e69de29b 100644
--- a/ipa-server/ipa-install/share/Makefile
+++ b/ipa-server/ipa-install/share/Makefile
@@ -1,9 +0,0 @@
-SHAREDIR = $(DESTDIR)/usr/share/ipa
-
-install:
- -mkdir -p $(SHAREDIR)
- install -m 644 *.ldif $(SHAREDIR)
- install -m 644 *.template $(SHAREDIR)
-
-clean:
- rm -f *~
diff --git a/ipa-server/ipa-kpasswd/Makefile b/ipa-server/ipa-kpasswd/Makefile
index 5fd90a69..918f74d0 100644
--- a/ipa-server/ipa-kpasswd/Makefile
+++ b/ipa-server/ipa-kpasswd/Makefile
@@ -1,9 +1,6 @@
-PREFIX ?= $(DESTDIR)/usr
-SBIN = $(PREFIX)/sbin
-INITDIR = $(DESTDIR)/etc/rc.d/init.d
+include ../Makefile.common
LDFLAGS +=-lkrb5 -llber -lldap
-CFLAGS ?= -g -Wall -Wshadow
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
@@ -14,8 +11,9 @@ all: $(OBJS)
$(CC) $(CFLAGS) -c -o $@ $<
install:
- -mkdir -p $(SBIN)
- install -m 755 ipa_kpasswd $(SBIN)
+ echo $(SBINDIR)
+ -mkdir -p $(SBINDIR)
+ install -m 755 ipa_kpasswd $(SBINDIR)
-mkdir -p $(INITDIR)
install -m 755 ipa-kpasswd.init $(INITDIR)/ipa-kpasswd
diff --git a/ipa-server/ipa-slapi-plugins/dna/Makefile b/ipa-server/ipa-slapi-plugins/dna/Makefile
index a4fccab2..1e37d779 100644
--- a/ipa-server/ipa-slapi-plugins/dna/Makefile
+++ b/ipa-server/ipa-slapi-plugins/dna/Makefile
@@ -1,12 +1,7 @@
-DIRSRV ?= dirsrv
-PREFIX ?= $(DESTDIR)/usr
-LIBDIR ?= $(PREFIX)/lib/$(DIRSRV)/plugins
-LIB64DIR ?= $(PREFIX)/lib64/$(DIRSRV)/plugins
-SHAREDIR = $(DESTDIR)/usr/share/ipa
+include ../../Makefile.common
SONAME = libipa-dna-plugin.so
LDFLAGS += -llber
-CFLAGS ?= -g -Wall -Wshadow
CFLAGS += -I/usr/include/$(DIRSRV) -I/usr/include/nss3 -I/usr/include/mozldap -I/usr/include/nspr4 -fPIC -DPIC
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
@@ -18,12 +13,8 @@ all: $(OBJS)
$(CC) $(CFLAGS) -c -o $@ $<
install:
- -mkdir -p $(LIBDIR)
- if [ -e $(PREFIX)/lib/$(DIRSRV) ]; then \
- install -m 644 $(SONAME) $(LIBDIR); \
- else \
- install -m 644 $(SONAME) $(LIB64DIR); \
- fi
+ mkdir -p $(PLUGINDIR); \
+ install -m 644 $(SONAME) $(PLUGINDIR); \
install -m 644 *.ldif $(SHAREDIR)
clean:
diff --git a/ipa-server/ipa-slapi-plugins/ipa-memberof/Makefile b/ipa-server/ipa-slapi-plugins/ipa-memberof/Makefile
index 71258e6b..e13446c4 100644
--- a/ipa-server/ipa-slapi-plugins/ipa-memberof/Makefile
+++ b/ipa-server/ipa-slapi-plugins/ipa-memberof/Makefile
@@ -1,12 +1,7 @@
-DIRSRV ?= dirsrv
-PREFIX ?= $(DESTDIR)/usr
-LIBDIR ?= $(PREFIX)/lib/$(DIRSRV)/plugins
-LIB64DIR ?= $(PREFIX)/lib64/$(DIRSRV)/plugins
-SHAREDIR = $(DESTDIR)/usr/share/ipa
+include ../../Makefile.common
SONAME = libipa-memberof-plugin.so
LDFLAGS += -llber
-CFLAGS ?= -g -Wall -Wshadow
CFLAGS += -I/usr/include/$(DIRSRV) -I/usr/include/nss3 -I/usr/include/mozldap -I/usr/include/nspr4 -fPIC -DPIC
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
@@ -18,12 +13,8 @@ all: $(OBJS)
$(CC) $(CFLAGS) -c -o $@ $<
install:
- -mkdir -p $(LIBDIR)
- if [ -e $(PREFIX)/lib/$(DIRSRV) ]; then \
- install -m 644 $(SONAME) $(LIBDIR); \
- else \
- install -m 644 $(SONAME) $(LIB64DIR); \
- fi
+ mkdir -p $(PLUGINDIR); \
+ install -m 644 $(SONAME) $(PLUGINDIR); \
install -m 644 *.ldif $(SHAREDIR)
clean:
diff --git a/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/Makefile b/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/Makefile
index 7d676146..034b8e60 100644
--- a/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/Makefile
+++ b/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/Makefile
@@ -1,12 +1,7 @@
-DIRSRV ?= dirsrv
-PREFIX ?= $(DESTDIR)/usr
-LIBDIR = $(PREFIX)/lib/$(DIRSRV)/plugins
-LIB64DIR ?= $(PREFIX)/lib64/$(DIRSRV)/plugins
-SHAREDIR = $(DESTDIR)/usr/share/ipa
+include ../../Makefile.common
SONAME = libipa_pwd_extop.so
LDFLAGS += -lkrb5 -llber -lldap -llber -lssl
-CFLAGS ?= -g -Wall -Wshadow
CFLAGS += -I/usr/include/$(DIRSRV) -I/usr/include/nss3 -I/usr/include/mozldap -I/usr/include/nspr4 -fPIC -DPIC
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
@@ -18,12 +13,8 @@ all: $(OBJS)
$(CC) $(CFLAGS) -c -o $@ $<
install:
- -mkdir -p $(LIBDIR)
- if [ -e $(PREFIX)/lib/$(DIRSRV) ]; then \
- install -m 644 $(SONAME) $(LIBDIR); \
- else \
- install -m 644 $(SONAME) $(LIB64DIR); \
- fi
+ mkdir -p $(PLUGINDIR); \
+ install -m 644 $(SONAME) $(PLUGINDIR); \
install -m 644 *.ldif $(SHAREDIR)
clean:
diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py
index 5c59cfa7..30691115 100644
--- a/ipa-server/ipaserver/dsinstance.py
+++ b/ipa-server/ipaserver/dsinstance.py
@@ -214,7 +214,11 @@ class DsInstance:
def change_admin_password(self, password):
logging.debug("Changing admin password")
dirname = self.config_dirname()
- args = ["/usr/lib/mozldap/ldappasswd",
+ if dir_exists("/usr/lib64/mozldap"):
+ app = "/usr/lib64/mozldap/ldappasswd"
+ else:
+ app = "/usr/lib/mozldap/ldappasswd"
+ args = [app,
"-D", "cn=Directory Manager", "-w", self.dm_password,
"-P", dirname+"/cert8.db", "-ZZZ", "-s", password,
"uid=admin,cn=sysaccounts,cn=etc,"+self.suffix]
diff --git a/ipa-server/ipaserver/krbinstance.py b/ipa-server/ipaserver/krbinstance.py
index be70b035..03bc9200 100644
--- a/ipa-server/ipaserver/krbinstance.py
+++ b/ipa-server/ipaserver/krbinstance.py
@@ -202,7 +202,7 @@ class KrbInstance:
def __create_ds_keytab(self):
try:
os.remove("/etc/dirsrv/ds.keytab")
- except os.OSError:
+ except os.error :
print "Failed to remove /etc/dirsrv/ds.keytab."
(kwrite, kread, kerr) = os.popen3("/usr/kerberos/sbin/kadmin.local")
kwrite.write("addprinc -randkey ldap/"+self.fqdn+"@"+self.realm+"\n")
@@ -257,7 +257,7 @@ class KrbInstance:
def __create_http_keytab(self):
try:
os.remove("/etc/httpd/conf/ipa.keytab")
- except os.OSError:
+ except os.error:
print "Failed to remove /etc/httpd/conf/ipa.keytab."
(kwrite, kread, kerr) = os.popen3("/usr/kerberos/sbin/kadmin.local")
kwrite.write("addprinc -randkey HTTP/"+self.fqdn+"@"+self.realm+"\n")
diff --git a/ipa-server/xmlrpc-server/Makefile b/ipa-server/xmlrpc-server/Makefile
index 4bc657cb..80c24193 100644
--- a/ipa-server/xmlrpc-server/Makefile
+++ b/ipa-server/xmlrpc-server/Makefile
@@ -1,13 +1,13 @@
-SHAREDIR = $(DESTDIR)/usr/share/ipa/ipaserver
+include ../Makefile.common
all: ;
install:
-mkdir -p $(SHAREDIR)
- -mkdir -p $(SHAREDIR)/../html
- install -m 644 *.py $(SHAREDIR)
- install -m 644 ipa.conf $(SHAREDIR)/..
- install -m 644 *.html $(SHAREDIR)/../html
+ -mkdir -p $(SHAREDIR)/html
+ install -m 644 *.py $(SHAREDIR)/ipaserver
+ install -m 644 ipa.conf $(SHAREDIR)
+ install -m 644 *.html $(SHAREDIR)/html
clean:
rm -f *~ *.pyc