Hello all,

I spent the last few hours tweaking the Makefiles in Rivendell so that
it will compile seamlessly on Arch Linux systems.

Attached is an unified diff-formatted patch to address some issues
with the Makefile system.

I made my changes in such a way that they should not affect other
system, except for a few small details. Here is the list of
modifications:

#######################

  - cae/Makefile.am
    Problem: caed depends on pthread, but for some reason it does not
get included.
    Solution: add -lpthread to "caed_LDADD" variable.


  - configure.in:
    Problem: a lib path of "lib64" is forced for 64-bit systems. Some
systems (e.g. Arch) keep "/usr/lib" as path for "default"
architecture, and have a "lib32" directory instead for multilib
installations.

    Solution: I am not an autotools expert and I could not devise a
way to make it work for distributions that have "lib64" as a default
for 64-bit systems. On Arch, the standard is lib/lib32 on 64-bit
system and only "lib" on 32-bit. Other projects have defined an
additional variable (LIB_SUFFIX) which is set by configure during
compilation using "-DLIB_SUFFIX=64". This modification is therefore
incompatible with 64-bit distros that have lib64 as the default lib
path. This is a hack that should probably not be committed to repo.


  - lib/Makefile.am
    Problem: libtool can't figure out that librd.la needs to be linked
against some libraries
    Solution: specify those libraries manually, in "librd_la_LDADD"


  - pam_rd/Makefile.am
    Problems: 1-  out-of-directory packaging breaks libtool as it
tries to relink the library to a non-final directory, 2- installation
path does not honor prefix. On my system, the PAM libraries are in
/usr/lib/security/.

    Solution: specify "inst_prefix_dir" [1] and add $(prefix) to "inst_libdir".


  - rdselect/Makefile.am
    Problem: multiple parallel job compilation (make -j) usually fails
because it tries to "chmod" a file that was not yet installed

    Solution: rename target "install-exec-local" to "install-exec-hook". [2]


  - {icons,rlm,scripts,web/rdxport,xdg}/Makefile.am
    Problem: $(DESTDIR) not set, making staged installs impossible

    Solution: add $(DESTDIR) accordingly. Note that I did not fix the
"uninstall" counterparts as I did not need to.



1: https://www.gnu.org/software/libtool/manual/html_node/Install-mode.html
2: https://www.sourceware.org/autobook/autobook/autobook_108.html

######

Comments and criticism are more than welcome.

-- 
Sébastien Leblanc
diff -Naur rivendell-2.8.1-distclean/cae/Makefile.am rivendell-2.8.1-patched/cae/Makefile.am
--- rivendell-2.8.1-distclean/cae/Makefile.am	2014-03-10 01:03:30.089863481 -0400
+++ rivendell-2.8.1-patched/cae/Makefile.am	2014-03-10 01:10:22.901034082 -0400
@@ -41,7 +41,8 @@
 nodist_caed_SOURCES = moc_cae.cpp\
                       moc_cae_socket.cpp
 
-caed_LDADD = @LIB_RDLIBS@\
+caed_LDADD = -lpthread\
+             @LIB_RDLIBS@\
              @LIBALSA@\
              @LIBHPI@\
              @LIBJACK@\
diff -Naur rivendell-2.8.1-distclean/configure.in rivendell-2.8.1-patched/configure.in
--- rivendell-2.8.1-distclean/configure.in	2014-03-10 01:03:30.129866174 -0400
+++ rivendell-2.8.1-patched/configure.in	2014-03-10 01:09:46.811928529 -0400
@@ -96,8 +96,8 @@
 AC_SUBST(VENDOR,$ar_gcc_distro)
 AC_SUBST(ARCH,$ar_gcc_arch)
 if test $ar_gcc_arch = x86_64 ; then
-  LIB_PATH=$PREFIX/lib64
-  AC_SUBST(RD_LIB_PATH,lib64)
+  LIB_PATH=$PREFIX/lib
+  AC_SUBST(RD_LIB_PATH,lib)
 else
   LIB_PATH=$PREFIX/lib
   AC_SUBST(RD_LIB_PATH,lib)
diff -Naur rivendell-2.8.1-distclean/icons/Makefile.am rivendell-2.8.1-patched/icons/Makefile.am
--- rivendell-2.8.1-distclean/icons/Makefile.am	2014-03-10 01:03:30.093197038 -0400
+++ rivendell-2.8.1-patched/icons/Makefile.am	2014-03-10 00:59:05.542052023 -0400
@@ -31,18 +31,18 @@
 	cp redball.png $(DESTDIR)@libexecdir@
 	cp whiteball.png $(DESTDIR)@libexecdir@
 	cp progressbar.gif $(DESTDIR)@libexecdir@
-	mkdir -p @prefix@/share/icons/hicolor/16x16/apps
-	cp rivendell-16x16.png @prefix@/share/icons/hicolor/16x16/apps/rivendell.png
-	mkdir -p @prefix@/share/icons/hicolor/22x22/apps
-	cp rivendell-22x22.png @prefix@/share/icons/hicolor/22x22/apps/rivendell.png
-	mkdir -p @prefix@/share/icons/hicolor/32x32/apps
-	cp rivendell-32x32.png @prefix@/share/icons/hicolor/32x32/apps/rivendell.png
-	mkdir -p @prefix@/share/icons/hicolor/48x48/apps
-	cp rivendell-48x48.png @prefix@/share/icons/hicolor/48x48/apps/rivendell.png
-	mkdir -p @prefix@/share/icons/hicolor/64x64/apps
-	cp rivendell-64x64.png @prefix@/share/icons/hicolor/64x64/apps/rivendell.png
-	mkdir -p @prefix@/share/icons/hicolor/128x128/apps
-	cp rivendell-128x128.png @prefix@/share/icons/hicolor/128x128/apps/rivendell.png
+	mkdir -p $(DESTDIR)@prefix@/share/icons/hicolor/16x16/apps
+	cp rivendell-16x16.png $(DESTDIR)@prefix@/share/icons/hicolor/16x16/apps/rivendell.png
+	mkdir -p $(DESTDIR)@prefix@/share/icons/hicolor/22x22/apps
+	cp rivendell-22x22.png $(DESTDIR)@prefix@/share/icons/hicolor/22x22/apps/rivendell.png
+	mkdir -p $(DESTDIR)@prefix@/share/icons/hicolor/32x32/apps
+	cp rivendell-32x32.png $(DESTDIR)@prefix@/share/icons/hicolor/32x32/apps/rivendell.png
+	mkdir -p $(DESTDIR)@prefix@/share/icons/hicolor/48x48/apps
+	cp rivendell-48x48.png $(DESTDIR)@prefix@/share/icons/hicolor/48x48/apps/rivendell.png
+	mkdir -p $(DESTDIR)@prefix@/share/icons/hicolor/64x64/apps
+	cp rivendell-64x64.png $(DESTDIR)@prefix@/share/icons/hicolor/64x64/apps/rivendell.png
+	mkdir -p $(DESTDIR)@prefix@/share/icons/hicolor/128x128/apps
+	cp rivendell-128x128.png $(DESTDIR)@prefix@/share/icons/hicolor/128x128/apps/rivendell.png
 
 uninstall:	
 	rm -f $(DESTDIR)@libexecdir@/greencheckmark.png
diff -Naur rivendell-2.8.1-distclean/lib/Makefile.am rivendell-2.8.1-patched/lib/Makefile.am
--- rivendell-2.8.1-distclean/lib/Makefile.am	2014-03-10 01:03:30.006524536 -0400
+++ rivendell-2.8.1-patched/lib/Makefile.am	2014-03-10 01:16:29.365795223 -0400
@@ -314,6 +314,7 @@
                           moc_schedruleslist.cpp
 
 librd_la_LDFLAGS = -release $(VERSION)
+librd_la_LIBADD = -lcurl -lsndfile -lpam -lsamplerate
 
 EXTRA_DIST = gpl2.html\
              html_gpl2_win32.cpp\
diff -Naur rivendell-2.8.1-distclean/pam_rd/Makefile.am rivendell-2.8.1-patched/pam_rd/Makefile.am
--- rivendell-2.8.1-distclean/pam_rd/Makefile.am	2014-03-10 01:03:30.033192998 -0400
+++ rivendell-2.8.1-patched/pam_rd/Makefile.am	2014-03-10 00:59:05.542052023 -0400
@@ -32,8 +32,9 @@
 moc_%.cpp:	%.h
 	$(MOC) $< -o $@
 
+inst_prefix_dir=$(DESTDIR)
 inst_lib_LTLIBRARIES = pam_rd.la
-inst_libdir=/@RD_LIB_PATH@/security
+inst_libdir=$(prefix)/@RD_LIB_PATH@/security
 dist_pam_rd_la_SOURCES = pam_rd.cpp
 pam_rd_la_LDFLAGS = -module -shared -Xlinker -x -avoid-version -export-dynamic
 pam_rd_la_LIBADD = @LIB_RDLIBS@ -lpam @LIBVORBIS@
diff -Naur rivendell-2.8.1-distclean/rdselect/Makefile.am rivendell-2.8.1-patched/rdselect/Makefile.am
--- rivendell-2.8.1-distclean/rdselect/Makefile.am	2014-03-10 01:03:30.039860114 -0400
+++ rivendell-2.8.1-patched/rdselect/Makefile.am	2014-03-10 00:59:05.542052023 -0400
@@ -32,10 +32,10 @@
 	$(MOC) $< -o $@
 
 # I18N Stuff
-install-exec-local:	
+install-exec-hook: 
 	mkdir -p $(DESTDIR)$(prefix)/share/rivendell
 	cp rdselect_*.qm $(DESTDIR)$(prefix)/share/rivendell
-	chmod 4755 $(prefix)/bin/rdselect
+	chmod 4755 $(DESTDIR)$(prefix)/bin/rdselect
 
 uninstall:
 	rm -f $(DESTDIR)$(prefix)/share/rivendell/rdselect_*.qm
diff -Naur rivendell-2.8.1-distclean/rlm/Makefile.am rivendell-2.8.1-patched/rlm/Makefile.am
--- rivendell-2.8.1-distclean/rlm/Makefile.am	2014-03-10 01:03:30.036526557 -0400
+++ rivendell-2.8.1-patched/rlm/Makefile.am	2014-03-10 00:59:05.542052023 -0400
@@ -48,8 +48,8 @@
 install:	all
 	mkdir -p $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell
 	cp $(RLM_MODULES) $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/
-	mkdir -p $(headerdir)
-	cp rlm.h $(headerdir)
+	mkdir -p $(DESTDIR)$(headerdir)
+	cp rlm.h $(DESTDIR)$(headerdir)
 
 headerdir = $(includedir)/rlm
 header_HEADERS = rlm.h
diff -Naur rivendell-2.8.1-distclean/scripts/Makefile.am rivendell-2.8.1-patched/scripts/Makefile.am
--- rivendell-2.8.1-distclean/scripts/Makefile.am	2014-03-10 01:03:29.966521844 -0400
+++ rivendell-2.8.1-patched/scripts/Makefile.am	2014-03-10 00:59:05.542052023 -0400
@@ -23,8 +23,8 @@
 ## Use automake to process this into a Makefile.in
 
 install-exec-local:	
-	mkdir -p /etc/X11/xinit/xinitrc.d
-	cp start-rdmonitor.sh /etc/X11/xinit/xinitrc.d/
+	mkdir -p $(DESTDIR)/etc/X11/xinit/xinitrc.d
+	cp start-rdmonitor.sh $(DESTDIR)/etc/X11/xinit/xinitrc.d/
 
 uninstall-local:	
 	rm -f /etc/X11/xinit/xinitrc.d/start-rdmonitor.sh
@@ -55,4 +55,4 @@
 CLEANFILES = *~
 
 MAINTAINERCLEANFILES = *~\
-                       Makefile.in
+		       Makefile.in
diff -Naur rivendell-2.8.1-distclean/web/rdxport/Makefile.am rivendell-2.8.1-patched/web/rdxport/Makefile.am
--- rivendell-2.8.1-distclean/web/rdxport/Makefile.am	2014-03-10 01:03:30.033192998 -0400
+++ rivendell-2.8.1-patched/web/rdxport/Makefile.am	2014-03-10 00:59:05.542052023 -0400
@@ -29,8 +29,8 @@
 libexec_PROGRAMS = rdxport.cgi
 
 install-exec-hook:	
-	chown root $(libexecdir)/rdxport.cgi
-	chmod 4755 $(libexecdir)/rdxport.cgi
+	chown root $(DESTDIR)$(libexecdir)/rdxport.cgi
+	chmod 4755 $(DESTDIR)$(libexecdir)/rdxport.cgi
 
 dist_rdxport_cgi_SOURCES = audioinfo.cpp\
                            carts.cpp\
diff -Naur rivendell-2.8.1-distclean/xdg/Makefile.am rivendell-2.8.1-patched/xdg/Makefile.am
--- rivendell-2.8.1-distclean/xdg/Makefile.am	2014-03-10 01:03:30.126532616 -0400
+++ rivendell-2.8.1-patched/xdg/Makefile.am	2014-03-10 00:59:05.542052023 -0400
@@ -22,29 +22,29 @@
 ## Use automake to process this into a Makefile.in
 
 install-exec-am:	
-	mkdir -p @prefix@/share/applications
-	cp rivendell-rdadmin.desktop @prefix@/share/applications/
-	cp rivendell-rdairplay.desktop @prefix@/share/applications/
-	cp rivendell-rdalsaconfig.desktop @prefix@/share/applications/
-	cp rivendell-rdcartslots.desktop @prefix@/share/applications/
-	cp rivendell-rdcastmanager.desktop @prefix@/share/applications/
-	cp rivendell-rdcatch.desktop @prefix@/share/applications/
-	cp rivendell-rddgimport.desktop @prefix@/share/applications/
-	cp rivendell-rddiscimport.desktop @prefix@/share/applications/
-	cp rivendell-rdgpimon.desktop @prefix@/share/applications/
-	cp rivendell-rdhpiinfo.desktop @prefix@/share/applications/
-	cp rivendell-rdlibrary.desktop @prefix@/share/applications/
-	cp rivendell-rdlogedit.desktop @prefix@/share/applications/
-	cp rivendell-rdlogin.desktop @prefix@/share/applications/
-	cp rivendell-rdlogmanager.desktop @prefix@/share/applications/
-	cp rivendell-rdmonitor.desktop @prefix@/share/applications/
-	cp rivendell-rdpanel.desktop @prefix@/share/applications/
-	cp rivendell-rdsoftkeys.desktop @prefix@/share/applications/
-	cp rivendell-rmlsend.desktop @prefix@/share/applications/
-	mkdir -p @prefix@/share/desktop-directories
-	cp *.directory @prefix@/share/desktop-directories/
-	mkdir -p /etc/xdg/menus/applications-merged
-	cp *.menu /etc/xdg/menus/applications-merged/
+	mkdir -p $(DESTDIR)@prefix@/share/applications
+	cp rivendell-rdadmin.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdairplay.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdalsaconfig.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdcartslots.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdcastmanager.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdcatch.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rddgimport.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rddiscimport.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdgpimon.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdhpiinfo.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdlibrary.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdlogedit.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdlogin.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdlogmanager.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdmonitor.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdpanel.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rdsoftkeys.desktop $(DESTDIR)@prefix@/share/applications/
+	cp rivendell-rmlsend.desktop $(DESTDIR)@prefix@/share/applications/
+	mkdir -p $(DESTDIR)@prefix@/share/desktop-directories
+	cp *.directory $(DESTDIR)@prefix@/share/desktop-directories/
+	mkdir -p $(DESTDIR)/etc/xdg/menus/applications-merged
+	cp *.menu $(DESTDIR)/etc/xdg/menus/applications-merged/
 
 uninstall:	
 	rm -f @prefix@/share/applications/rivendell-*.desktop
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to