Fix Python extension build (thanks to sven.s.jonsson)
authorMilan Broz <mbroz@redhat.com>
Sat, 3 Mar 2012 17:47:33 +0000 (18:47 +0100)
committerMilan Broz <mbroz@redhat.com>
Sat, 3 Mar 2012 17:47:33 +0000 (18:47 +0100)
python/Makefile.am
python/pycryptsetup-test.py

index 2f69be4..3bba8e1 100644 (file)
@@ -10,7 +10,7 @@ pyexec_LTLIBRARIES = pycryptsetup.la
 pycryptsetup_la_SOURCES = pycryptsetup.c
 pycryptsetup_la_CPPFLAGS = $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -fno-strict-aliasing
 pycryptsetup_la_LDFLAGS = -avoid-version -module
-pycryptsetup_la_LIBADD = $(top_srcdir)/lib/libcryptsetup.la -lpython$(PYTHON_VERSION)
+pycryptsetup_la_LIBADD = $(top_builddir)/lib/libcryptsetup.la -lpython$(PYTHON_VERSION)
 else
 all:
 endif
index 9923770..cac42be 100755 (executable)
@@ -52,6 +52,10 @@ def print_status(c):
        print "ERROR"
     return
 
+if os.geteuid() != 0:
+       print "WARNING: You must be root to run this test, test skipped."
+       sys.exit(0)
+
 os.system("dd if=/dev/zero of=" + IMG + " bs=1M count=32 >/dev/null 2>&1")
 
 c = pycryptsetup.CryptSetup(