From cc1c8b6f66915c819f94ecec5a8e4c0c2cd8d28f Mon Sep 17 00:00:00 2001
From: Alexander Mueller <alexander.mueller@hs.uni-hamburg.de>
Date: Wed, 19 Oct 2005 08:29:46 +0000
Subject: [PATCH] BugID: 377 Changes of build files and new files added to be
 able to install all GCF packages by means of rpms.

---
 MAC/GCF/GCFCommon/GCFCommon.spec.in           | 160 ++++++++++++++++++
 MAC/GCF/GCFCommon/Makefile.am                 |  10 +-
 MAC/GCF/GCFCommon/configure.in                |  22 +--
 MAC/GCF/GCFCommon/include/GCF/Makefile.am     |  32 ++++
 MAC/GCF/GCFCommon/include/Makefile.am         |   3 +
 MAC/GCF/GCFCommon/pvss/Makefile.am            |   3 +
 .../GCFCommon/pvss/scripts/libs/Makefile.am   |   7 +
 MAC/GCF/GCFCommon/src/Makefile.am             |  24 +--
 MAC/GCF/LogSys/CLP/src/Makefile.am            |  14 +-
 MAC/GCF/LogSys/GCFLogSys.spec.in              | 160 ++++++++++++++++++
 MAC/GCF/LogSys/KVLogSys/src/Makefile.am       |  32 ++--
 MAC/GCF/LogSys/Makefile.am                    |  10 +-
 MAC/GCF/LogSys/configure.in                   |   8 +-
 MAC/GCF/LogSys/include/GCF/LogSys/Makefile.am |  17 ++
 MAC/GCF/LogSys/include/Makefile.am            |   3 +
 MAC/GCF/Protocols/GCFProtocols.spec.in        | 160 ++++++++++++++++++
 MAC/GCF/Protocols/Makefile.am                 |   9 +
 MAC/GCF/Protocols/configure.in                |  18 +-
 MAC/GCF/TM/GCFTM.spec.in                      | 160 ++++++++++++++++++
 MAC/GCF/TM/Makefile.am                        |  10 +-
 MAC/GCF/TM/autogen/Makefile.am                |   3 +
 MAC/GCF/TM/configure.in                       |  24 +--
 MAC/GCF/TM/include/GCF/TM/Makefile.am         |  29 ++++
 MAC/GCF/TM/include/Makefile.am                |   3 +
 MAC/GCF/TM/src/Makefile.am                    |  22 +--
 MAC/GCF/TM/src/ServiceBroker/Makefile.am      |   8 +-
 MAC/GCF/TM/test/Makefile.am                   |   7 +-
 MAC/GCF/_PAL/GCFPAL.spec.in                   | 160 ++++++++++++++++++
 MAC/GCF/_PAL/Makefile.am                      |  10 +-
 MAC/GCF/_PAL/PA/Makefile.am                   |   2 +-
 MAC/GCF/_PAL/PA/pvss/Makefile.am              |   3 +
 MAC/GCF/_PAL/PA/pvss/panels/Makefile.am       |   8 +
 MAC/GCF/_PAL/PA/pvss/scripts/libs/Makefile.am |  10 ++
 MAC/GCF/_PAL/PA/src/Makefile.am               |  16 +-
 MAC/GCF/_PAL/PA/src/preparePVSS-DB            |   2 +-
 MAC/GCF/_PAL/PI/src/Makefile.am               |   4 +-
 MAC/GCF/_PAL/PML/src/Makefile.am              |  18 +-
 MAC/GCF/_PAL/SAL/src/Makefile.am              |   9 +-
 MAC/GCF/_PAL/SAL/test/Makefile.am             |   7 +-
 MAC/GCF/_PAL/configure.in                     |  25 +--
 MAC/GCF/_PAL/include/GCF/PAL/Makefile.am      |  27 +++
 MAC/GCF/_PAL/include/Makefile.am              |   3 +
 .../_PALlight/CEP-PMLlight/src/Makefile.am    |   9 +-
 MAC/GCF/_PALlight/GCFPALlight.spec.in         | 160 ++++++++++++++++++
 MAC/GCF/_PALlight/Makefile.am                 |  10 +-
 MAC/GCF/_PALlight/PMLlight/src/Makefile.am    |  15 +-
 MAC/GCF/_PALlight/configure.in                |  21 +--
 .../include/GCF/PALlight/Makefile.am          |  21 +++
 MAC/GCF/_PALlight/include/Makefile.am         |   3 +
 49 files changed, 1266 insertions(+), 235 deletions(-)
 create mode 100644 MAC/GCF/GCFCommon/GCFCommon.spec.in
 create mode 100644 MAC/GCF/GCFCommon/include/GCF/Makefile.am
 create mode 100644 MAC/GCF/GCFCommon/include/Makefile.am
 create mode 100644 MAC/GCF/GCFCommon/pvss/Makefile.am
 create mode 100644 MAC/GCF/GCFCommon/pvss/scripts/libs/Makefile.am
 create mode 100644 MAC/GCF/LogSys/GCFLogSys.spec.in
 create mode 100644 MAC/GCF/LogSys/include/GCF/LogSys/Makefile.am
 create mode 100644 MAC/GCF/LogSys/include/Makefile.am
 create mode 100644 MAC/GCF/Protocols/GCFProtocols.spec.in
 create mode 100644 MAC/GCF/TM/GCFTM.spec.in
 create mode 100644 MAC/GCF/TM/include/GCF/TM/Makefile.am
 create mode 100644 MAC/GCF/TM/include/Makefile.am
 create mode 100644 MAC/GCF/_PAL/GCFPAL.spec.in
 create mode 100644 MAC/GCF/_PAL/PA/pvss/Makefile.am
 create mode 100644 MAC/GCF/_PAL/PA/pvss/panels/Makefile.am
 create mode 100644 MAC/GCF/_PAL/PA/pvss/scripts/libs/Makefile.am
 create mode 100644 MAC/GCF/_PAL/include/GCF/PAL/Makefile.am
 create mode 100644 MAC/GCF/_PAL/include/Makefile.am
 create mode 100644 MAC/GCF/_PALlight/GCFPALlight.spec.in
 create mode 100644 MAC/GCF/_PALlight/include/GCF/PALlight/Makefile.am
 create mode 100644 MAC/GCF/_PALlight/include/Makefile.am

diff --git a/MAC/GCF/GCFCommon/GCFCommon.spec.in b/MAC/GCF/GCFCommon/GCFCommon.spec.in
new file mode 100644
index 00000000000..a52d85da10a
--- /dev/null
+++ b/MAC/GCF/GCFCommon/GCFCommon.spec.in
@@ -0,0 +1,160 @@
+# -*- Mode:rpm-spec -*-
+# GCFCommon.spec.in
+#
+
+##############################################################################
+#
+# Preamble
+#
+##############################################################################
+
+Summary: GCFCommon is the common GCF software package providing a set of GCF wide type definitions.
+
+%define release @RPM_RELEASE@
+%define version @VERSION@
+%define pkgname @PACKAGE@
+%define pkgdir %{pkgname}-%{version}-%{release}
+%define prefix /opt/lofar
+%define configure_args @RPM_CONFIGURE_ARGS@
+##define build_kernel_version @BUILD_KERNEL_VERSION@
+
+Name: %{pkgname}
+Version: %{version}
+Release: %{release}
+Copyright: LGPL
+Group: Application/System
+Source: %{pkgname}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{pkgdir}-root
+URL: http://www.astron.nl
+Prefix: %{prefix}
+BuildArchitectures: i386 # Target platforms, i.e., i586
+Requires: Common 
+Packager: %{packager}
+Distribution: The LOFAR project
+Vendor: ASTRON
+
+AutoReqProv: no
+
+%description
+
+GCFCommon is the package handling the data transport in LOFAR.
+
+##############################################################################
+#
+# prep
+#
+##############################################################################
+%prep
+echo $prefix
+
+# create the build directory, untar the source
+%setup
+
+##############################################################################
+#
+# build
+#
+##############################################################################
+%build
+./configure %{configure_args} --prefix=%{prefix} && make
+
+##############################################################################
+#
+# install
+#
+##############################################################################
+%install
+# To make things work with BUILDROOT
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+make DESTDIR="$RPM_BUILD_ROOT" install
+
+#uninstall
+
+##############################################################################
+#
+# verify
+#
+##############################################################################
+#verify
+
+##############################################################################
+#
+# clean
+#
+##############################################################################
+%clean
+# Call me paranoid, but I do not want to be responsible for nuking
+# someone's harddrive!
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+
+##############################################################################
+#
+# files
+#
+##############################################################################
+
+# empty 'files' means all distributed files
+%files
+%defattr(-, root, root)
+%{prefix}
+
+# Your application file list goes here
+# %{prefix}/lib/lib*.so*
+
+# Documentation
+# doc COPYING ChangeLog README AUTHORS NEWS
+# doc doc/*
+
+# link the module to the correct path
+%post 
+
+# before uninstall
+%preun
+
+# after uninstall
+%postun
+
+##############################################################################
+#
+# package devel
+#
+##############################################################################
+
+#package devel
+#Summary: Development files for %{pkgname}
+#Group: Applications/System
+#description devel
+#Development files for %{pkgname}.
+
+#files devel
+
+# Your development files go here
+# Programmers documentation goes here
+#doc doc
+
+# end of file
diff --git a/MAC/GCF/GCFCommon/Makefile.am b/MAC/GCF/GCFCommon/Makefile.am
index a014c15b3e0..85eaccfa0b6 100644
--- a/MAC/GCF/GCFCommon/Makefile.am
+++ b/MAC/GCF/GCFCommon/Makefile.am
@@ -1,3 +1,11 @@
-SUBDIRS=src
+SUBDIRS=src include pvss
+
+DISTCHECK_CONFIGURE_FLAGS=\
+      --with-common=$(prefix)
+
+EXTRA_DIST = \
+      Makefile.common \
+      GCFCommon.spec \
+      autoconf_share/compiletool
 
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/GCFCommon/configure.in b/MAC/GCF/GCFCommon/configure.in
index 10384329d76..2aed4a9259a 100644
--- a/MAC/GCF/GCFCommon/configure.in
+++ b/MAC/GCF/GCFCommon/configure.in
@@ -5,7 +5,7 @@ AC_INIT(include/GCF/GCF_Defines.h)
 dnl AC_CONFIG_AUX_DIR(config)
 dnl AM_CONFIG_HEADER(config/config.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(GCFCommon, 6.0)
+AM_INIT_AUTOMAKE(GCFCommon, 6.0, no-define)
 
 dnl Initialize for LOFAR (may set compilers)
 lofar_INIT
@@ -23,19 +23,6 @@ AC_PROG_LIBTOOL
 
 dnl Checks for libraries.
 
-dnl dnl Replace `main' with a function in -lfl:
-dnl AC_CHECK_LIB(fl, main)
-dnl dnl Replace `main' with a function in -lcosev_r:
-dnl AC_CHECK_LIB(cosev_r, main)
-dnl dnl Replace `main' with a function in -lcosnm_r:
-dnl AC_CHECK_LIB(cosnm_r, main)
-dnl dnl Replace `main' with a function in -lorb_r:
-dnl AC_CHECK_LIB(orb_r, main)
-dnl dnl Replace `main' with a function in -lpthread:
-dnl AC_CHECK_LIB(pthread, main)
-dnl dnl Replace `main' with a function in -lvport_r:
-dnl AC_CHECK_LIB(vport_r, main)
-
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(unistd.h)
@@ -51,8 +38,6 @@ dnl
 dnl Check for LOFAR specific things
 dnl
 lofar_GENERAL
-#lofar_QT
-lofar_MPI(0)
 lofar_INTERNAL(LCS/Common, Common, LCS-Common-2_3, 1, Common/LofarTypes.h,,)
 
 dnl
@@ -60,5 +45,10 @@ dnl Output Makefiles
 dnl
 AC_OUTPUT(
 src/Makefile
+include/Makefile
+include/GCF/Makefile
+pvss/Makefile
+pvss/scripts/libs/Makefile
 Makefile
+GCFCommon.spec
 )
diff --git a/MAC/GCF/GCFCommon/include/GCF/Makefile.am b/MAC/GCF/GCFCommon/include/GCF/Makefile.am
new file mode 100644
index 00000000000..95a66379bee
--- /dev/null
+++ b/MAC/GCF/GCFCommon/include/GCF/Makefile.am
@@ -0,0 +1,32 @@
+INSTHDRS =
+
+pkgincludedir = $(includedir)/GCF
+pkginclude_HEADERS = \
+	GCF_PValue.h \
+	GCF_PVChar.h \
+	GCF_PVBool.h \
+	GCF_PVDouble.h \
+	GCF_PVString.h \
+	GCF_PVInteger.h \
+	GCF_PVUnsigned.h \
+	GCF_PVDynArr.h \
+	GCF_PVBlob.h \
+	CmdLine.h \
+	Utils.h \
+	GCF_Defines.h \
+	ParameterSet.h \
+	Thread.h \
+	Mutex.h
+
+NOINSTHDRS =
+
+TCCHDRS = 
+
+nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS)
+
+noinst_HEADERS = $(NOINSTHDRS)
+
+DOCHDRS	= $(INSTHDRS) $(NOINSTHDRS)
+
+include $(top_srcdir)/Makefile.common
+
diff --git a/MAC/GCF/GCFCommon/include/Makefile.am b/MAC/GCF/GCFCommon/include/Makefile.am
new file mode 100644
index 00000000000..eb27ea4dbf1
--- /dev/null
+++ b/MAC/GCF/GCFCommon/include/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS	= GCF
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/GCFCommon/pvss/Makefile.am b/MAC/GCF/GCFCommon/pvss/Makefile.am
new file mode 100644
index 00000000000..4db09088aa2
--- /dev/null
+++ b/MAC/GCF/GCFCommon/pvss/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS=scripts/libs
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/GCFCommon/pvss/scripts/libs/Makefile.am b/MAC/GCF/GCFCommon/pvss/scripts/libs/Makefile.am
new file mode 100644
index 00000000000..57a9effdbf0
--- /dev/null
+++ b/MAC/GCF/GCFCommon/pvss/scripts/libs/Makefile.am
@@ -0,0 +1,7 @@
+pkgdatadir = $(datadir)/pvss/scripts/libs
+pkgdata_DATA = gcf-common.ctl
+
+EXTRA_DIST = $(pkgdata_DATA)
+
+include $(top_srcdir)/Makefile.common
+
diff --git a/MAC/GCF/GCFCommon/src/Makefile.am b/MAC/GCF/GCFCommon/src/Makefile.am
index 68173a08da7..fdbb4d98561 100644
--- a/MAC/GCF/GCFCommon/src/Makefile.am
+++ b/MAC/GCF/GCFCommon/src/Makefile.am
@@ -1,25 +1,9 @@
-pkgincludedir = $(includedir)/GCF
-pkginclude_HEADERS = \
-	../include/GCF/GCF_PValue.h \
-	../include/GCF/GCF_PVChar.h \
-	../include/GCF/GCF_PVBool.h \
-	../include/GCF/GCF_PVDouble.h \
-	../include/GCF/GCF_PVString.h \
-	../include/GCF/GCF_PVInteger.h \
-	../include/GCF/GCF_PVUnsigned.h \
-	../include/GCF/GCF_PVDynArr.h \
-	../include/GCF/GCF_PVBlob.h \
-	../include/GCF/CmdLine.h \
-	../include/GCF/Utils.h \
-	../include/GCF/GCF_Defines.h \
-	../include/GCF/ParameterSet.h \
-	../include/GCF/Thread.h \
-	../include/GCF/Mutex.h
-
-DOCHDRS	=	$(pkginclude_HEADERS)
+DOCHDRS	=	GCO_Defines.h
       
 lib_LTLIBRARIES 	= libgcfcommon.la
 
+libgcfcommon_la_DEPENDENCIES	= $(LOFAR_DEPEND)
+
 libgcfcommon_la_SOURCES= $(DOCHDRS) \
 	CmdLine.cc \
 	Utils.cc \
@@ -35,7 +19,5 @@ libgcfcommon_la_SOURCES= $(DOCHDRS) \
 	ParameterSet.cc \
 	Thread.cc
 	
-libgcfcommon_la_CPPFLAGS=-I$(top_srcdir)/include
-
 include $(top_srcdir)/Makefile.common
 
diff --git a/MAC/GCF/LogSys/CLP/src/Makefile.am b/MAC/GCF/LogSys/CLP/src/Makefile.am
index 00f49f68d34..790948c3041 100644
--- a/MAC/GCF/LogSys/CLP/src/Makefile.am
+++ b/MAC/GCF/LogSys/CLP/src/Makefile.am
@@ -1,7 +1,4 @@
-pkgincludedir = $(includedir)/GCF/LogSys
-pkginclude_HEADERS =
-	
-DOCHDRS	=	$(pkginclude_HEADERS) \
+DOCHDRS	=	\
 	CodeLoggingProcessor.h \
 	PropertyProxy.h
    
@@ -12,9 +9,7 @@ libclp_la_SOURCES	= $(DOCHDRS) \
 	PropertyProxy.cc
 
 libclp_la_LIBADD		= 
-libclp_la_CPPFLAGS= -DLOFARLOGGER_SUBPACKAGE=\"CLP\" \
-	-I$(top_srcdir)/include
-
+AM_CPPFLAGS= -DLOFARLOGGER_SUBPACKAGE=\"CLP\"
 
 bin_PROGRAMS   		= CodeLoggingProcessor
   
@@ -23,11 +18,12 @@ CodeLoggingProcessor_LDADD		    = libclp.la $(LOFAR_DEPEND) \
 	$(top_builddir)/KVLogSys/src/libgcfkvlc.la
 CodeLoggingProcessor_DEPENDENCIES	= libclp.la $(LOFAR_DEPEND) \
 	$(top_builddir)/KVLogSys/src/libgcfkvlc.la
-CodeLoggingProcessor_CPPFLAGS			= $(libclp_la_CPPFLAGS)
 
 BUILT_SOURCES =
 
-EXTRA_DIST = $(BUILT_SOURCES)
+EXTRA_DIST = $(BUILT_SOURCES) \
+	CodeLoggingProcessor.conf.in \
+	CodeLoggingProcessor.log_prop.in
 
 sysconf_DATA= \
 	CodeLoggingProcessor.conf \
diff --git a/MAC/GCF/LogSys/GCFLogSys.spec.in b/MAC/GCF/LogSys/GCFLogSys.spec.in
new file mode 100644
index 00000000000..d1eb8725268
--- /dev/null
+++ b/MAC/GCF/LogSys/GCFLogSys.spec.in
@@ -0,0 +1,160 @@
+# -*- Mode:rpm-spec -*-
+# GCFLogSys.spec.in
+#
+
+##############################################################################
+#
+# Preamble
+#
+##############################################################################
+
+Summary: GCFLogSys is the common GCF software package providing a set of GCF wide type definitions.
+
+%define release @RPM_RELEASE@
+%define version @VERSION@
+%define pkgname @PACKAGE@
+%define pkgdir %{pkgname}-%{version}-%{release}
+%define prefix /opt/lofar
+%define configure_args @RPM_CONFIGURE_ARGS@
+##define build_kernel_version @BUILD_KERNEL_VERSION@
+
+Name: %{pkgname}
+Version: %{version}
+Release: %{release}
+Copyright: LGPL
+Group: Application/System
+Source: %{pkgname}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{pkgdir}-root
+URL: http://www.astron.nl
+Prefix: %{prefix}
+BuildArchitectures: i386 # Target platforms, i.e., i586
+Requires: Common, GCFCommon, GCFTM, GCFProtocols, GCFPAL
+Packager: %{packager}
+Distribution: The LOFAR project
+Vendor: ASTRON
+
+AutoReqProv: no
+
+%description
+
+GCFLogSys is the package handling the data transport in LOFAR.
+
+##############################################################################
+#
+# prep
+#
+##############################################################################
+%prep
+echo $prefix
+
+# create the build directory, untar the source
+%setup
+
+##############################################################################
+#
+# build
+#
+##############################################################################
+%build
+./configure %{configure_args} --prefix=%{prefix} && make
+
+##############################################################################
+#
+# install
+#
+##############################################################################
+%install
+# To make things work with BUILDROOT
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+make DESTDIR="$RPM_BUILD_ROOT" install
+
+#uninstall
+
+##############################################################################
+#
+# verify
+#
+##############################################################################
+#verify
+
+##############################################################################
+#
+# clean
+#
+##############################################################################
+%clean
+# Call me paranoid, but I do not want to be responsible for nuking
+# someone's harddrive!
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+
+##############################################################################
+#
+# files
+#
+##############################################################################
+
+# empty 'files' means all distributed files
+%files
+%defattr(-, root, root)
+%{prefix}
+
+# Your application file list goes here
+# %{prefix}/lib/lib*.so*
+
+# Documentation
+# doc COPYING ChangeLog README AUTHORS NEWS
+# doc doc/*
+
+# link the module to the correct path
+%post 
+
+# before uninstall
+%preun
+
+# after uninstall
+%postun
+
+##############################################################################
+#
+# package devel
+#
+##############################################################################
+
+#package devel
+#Summary: Development files for %{pkgname}
+#Group: Applications/System
+#description devel
+#Development files for %{pkgname}.
+
+#files devel
+
+# Your development files go here
+# Programmers documentation goes here
+#doc doc
+
+# end of file
diff --git a/MAC/GCF/LogSys/KVLogSys/src/Makefile.am b/MAC/GCF/LogSys/KVLogSys/src/Makefile.am
index 53a91874772..ee2c4f56edc 100644
--- a/MAC/GCF/LogSys/KVLogSys/src/Makefile.am
+++ b/MAC/GCF/LogSys/KVLogSys/src/Makefile.am
@@ -4,12 +4,8 @@ SUFFIXES = .ph
 %.ph: %.prot
 	$(AUTOGEN) --writable -L $(datadir)/GCF/TM $<
 
-pkgincludedir = $(includedir)/GCF/LogSys
-pkginclude_HEADERS = \
-	../../include/GCF/LogSys/GCF_KeyValueLogger.h
-	
-DOCHDRS	=	$(pkginclude_HEADERS) \
-	KVDefines.h \
+DOCHDRS	=	\
+	KVLDefines.h \
 	KeyValueLoggerDaemon.h \
 	KeyValueLoggerMaster.h \
 	KVLUtils.h \
@@ -23,15 +19,15 @@ libgcfkvlc_la_SOURCES= $(DOCHDRS) \
 	
 libgcfkvlc_la_LIBADD= libkvlprot.la
 libgcfkvlc_la_DEPENDENCIES= libkvlprot.la $(LOFAR_DEPEND)
-libgcfkvlc_la_CPPFLAGS= -I$(top_srcdir)/include \
-	-DLOFARLOGGER_SUBPACKAGE=\"KVLC\"
+libgcfkvlc_la_CPPFLAGS= -DLOFARLOGGER_SUBPACKAGE=\"KVLC\"
 
+bin_PROGRAMS   		= KeyValueLoggerDaemon KeyValueLoggerMaster
 noinst_LTLIBRARIES 	= libkvlprot.la libkvld.la libkvlm.la
 
 libkvlprot_la_SOURCES= $(DOCHDRS) \
   KVL_Protocol.cc \
   KVLUtils.cc
-
+  
 libkvld_la_SOURCES	= $(DOCHDRS) \
 	KeyValueLoggerDaemon.cc \
 	PropertyLogger.cc
@@ -39,28 +35,28 @@ libkvld_la_SOURCES	= $(DOCHDRS) \
 libkvld_la_LIBADD		= libkvlprot.la
 libkvld_la_CPPFLAGS= -DLOFARLOGGER_SUBPACKAGE=\"KVLD\"
 
+KeyValueLoggerDaemon_SOURCES		  = KVLDMain.cc
+KeyValueLoggerDaemon_LDADD		    = libkvld.la $(LOFAR_DEPEND)
+KeyValueLoggerDaemon_DEPENDENCIES	= libkvld.la $(LOFAR_DEPEND)
+KeyValueLoggerDaemon_CPPFLAGS			= $(libkvld_la_CPPFLAGS)
+
 libkvlm_la_SOURCES	= $(DOCHDRS) \
 	KeyValueLoggerMaster.cc
 
 libkvlm_la_LIBADD		= libkvlprot.la
 libkvlm_la_CPPFLAGS= -DLOFARLOGGER_SUBPACKAGE=\"KVLM\"
 
-bin_PROGRAMS   		= KeyValueLoggerDaemon KeyValueLoggerMaster
-  
-KeyValueLoggerDaemon_SOURCES		  = KVLDMain.cc
-KeyValueLoggerDaemon_LDADD		    = libkvld.la $(LOFAR_DEPEND)
-KeyValueLoggerDaemon_DEPENDENCIES	= libkvld.la $(LOFAR_DEPEND)
-KeyValueLoggerDaemon_CPPFLAGS			= -DLOFARLOGGER_SUBPACKAGE=\"KVLD\"
-
 KeyValueLoggerMaster_SOURCES		  = KVLMMain.cc
 KeyValueLoggerMaster_LDADD		    = libkvlm.la $(LOFAR_DEPEND)
 KeyValueLoggerMaster_DEPENDENCIES	= libkvlm.la $(LOFAR_DEPEND)
-KeyValueLoggerMaster_CPPFLAGS			= -DLOFARLOGGER_SUBPACKAGE=\"KVLM\"
+KeyValueLoggerMaster_CPPFLAGS			= $(libkvlm_la_CPPFLAGS)
 
 BUILT_SOURCES = \
 	KVL_Protocol.ph
 
-EXTRA_DIST = $(BUILT_SOURCES)
+EXTRA_DIST = $(BUILT_SOURCES) \
+	KeyValueLoggerSys.conf.in \
+	KeyValueLoggerSys.log_prop.in
 	
 sysconf_DATA= \
 	KeyValueLoggerDaemon.conf \
diff --git a/MAC/GCF/LogSys/Makefile.am b/MAC/GCF/LogSys/Makefile.am
index cf7c4caa7da..f51b089b887 100644
--- a/MAC/GCF/LogSys/Makefile.am
+++ b/MAC/GCF/LogSys/Makefile.am
@@ -1,3 +1,11 @@
-SUBDIRS=KVLogSys CLP
+SUBDIRS=KVLogSys CLP include
+
+DISTCHECK_CONFIGURE_FLAGS=\
+      --with-common=$(prefix)
+
+EXTRA_DIST = \
+      Makefile.common \
+      GCFLogSys.spec \
+      autoconf_share/compiletool
 
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/LogSys/configure.in b/MAC/GCF/LogSys/configure.in
index ecc16ccd830..10d15dcb5ae 100644
--- a/MAC/GCF/LogSys/configure.in
+++ b/MAC/GCF/LogSys/configure.in
@@ -2,10 +2,8 @@ dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
 AC_INIT(include/GCF/LogSys/GCF_KeyValueLogger.h)
-dnl AC_CONFIG_AUX_DIR(config)
-dnl AM_CONFIG_HEADER(config/config.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(GCF/LogSys, 6.0)
+AM_INIT_AUTOMAKE(GCFLogSys, 6.0, no-define)
 
 dnl Initialize for LOFAR (may set compilers)
 lofar_INIT
@@ -38,7 +36,6 @@ dnl
 dnl Check for LOFAR specific things
 dnl
 lofar_GENERAL
-#lofar_QT
 lofar_PVSS
 lofar_INTERNAL(LCS/Common, common, LCS-Common-2_3, 1, Common/LofarTypes.h,,)
 lofar_INTERNAL(MAC/GCF/GCFCommon, gcfcommon, MAC-GCF-6_0, 1, GCF/GCF_Defines.h,,)
@@ -56,5 +53,8 @@ KVLogSys/src/Makefile
 KVLogSys/Makefile
 CLP/src/Makefile
 CLP/Makefile
+include/Makefile
+include/GCF/LogSys/Makefile
 Makefile
+GCFLogSys.spec
 )
diff --git a/MAC/GCF/LogSys/include/GCF/LogSys/Makefile.am b/MAC/GCF/LogSys/include/GCF/LogSys/Makefile.am
new file mode 100644
index 00000000000..1e2e18e800b
--- /dev/null
+++ b/MAC/GCF/LogSys/include/GCF/LogSys/Makefile.am
@@ -0,0 +1,17 @@
+INSTHDRS =
+
+pkgincludedir = $(includedir)/GCF/LogSys
+pkginclude_HEADERS = \
+	GCF_KeyValueLogger.h
+	
+NOINSTHDRS =
+
+TCCHDRS = 
+
+nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS)
+
+noinst_HEADERS = $(NOINSTHDRS)
+
+DOCHDRS	= $(INSTHDRS) $(NOINSTHDRS)
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/LogSys/include/Makefile.am b/MAC/GCF/LogSys/include/Makefile.am
new file mode 100644
index 00000000000..f1b5b81990c
--- /dev/null
+++ b/MAC/GCF/LogSys/include/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS	= GCF/LogSys
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/Protocols/GCFProtocols.spec.in b/MAC/GCF/Protocols/GCFProtocols.spec.in
new file mode 100644
index 00000000000..963b4b27952
--- /dev/null
+++ b/MAC/GCF/Protocols/GCFProtocols.spec.in
@@ -0,0 +1,160 @@
+# -*- Mode:rpm-spec -*-
+# GCFProtocols.spec.in
+#
+
+##############################################################################
+#
+# Preamble
+#
+##############################################################################
+
+Summary: GCFProtocols is the common GCF software package providing a set of GCF wide type definitions.
+
+%define release @RPM_RELEASE@
+%define version @VERSION@
+%define pkgname @PACKAGE@
+%define pkgdir %{pkgname}-%{version}-%{release}
+%define prefix /opt/lofar
+%define configure_args @RPM_CONFIGURE_ARGS@
+##define build_kernel_version @BUILD_KERNEL_VERSION@
+
+Name: %{pkgname}
+Version: %{version}
+Release: %{release}
+Copyright: LGPL
+Group: Application/System
+Source: %{pkgname}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{pkgdir}-root
+URL: http://www.astron.nl
+Prefix: %{prefix}
+BuildArchitectures: i386 # Target platforms, i.e., i586
+Requires: Common, GCFCommon, GCFTM, Transport 
+Packager: %{packager}
+Distribution: The LOFAR project
+Vendor: ASTRON
+
+AutoReqProv: no
+
+%description
+
+GCFProtocols is the package handling the data transport in LOFAR.
+
+##############################################################################
+#
+# prep
+#
+##############################################################################
+%prep
+echo $prefix
+
+# create the build directory, untar the source
+%setup
+
+##############################################################################
+#
+# build
+#
+##############################################################################
+%build
+./configure %{configure_args} --prefix=%{prefix} && make
+
+##############################################################################
+#
+# install
+#
+##############################################################################
+%install
+# To make things work with BUILDROOT
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+make DESTDIR="$RPM_BUILD_ROOT" install
+
+#uninstall
+
+##############################################################################
+#
+# verify
+#
+##############################################################################
+#verify
+
+##############################################################################
+#
+# clean
+#
+##############################################################################
+%clean
+# Call me paranoid, but I do not want to be responsible for nuking
+# someone's harddrive!
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+
+##############################################################################
+#
+# files
+#
+##############################################################################
+
+# empty 'files' means all distributed files
+%files
+%defattr(-, root, root)
+%{prefix}
+
+# Your application file list goes here
+# %{prefix}/lib/lib*.so*
+
+# Documentation
+# doc COPYING ChangeLog README AUTHORS NEWS
+# doc doc/*
+
+# link the module to the correct path
+%post 
+
+# before uninstall
+%preun
+
+# after uninstall
+%postun
+
+##############################################################################
+#
+# package devel
+#
+##############################################################################
+
+#package devel
+#Summary: Development files for %{pkgname}
+#Group: Applications/System
+#description devel
+#Development files for %{pkgname}.
+
+#files devel
+
+# Your development files go here
+# Programmers documentation goes here
+#doc doc
+
+# end of file
diff --git a/MAC/GCF/Protocols/Makefile.am b/MAC/GCF/Protocols/Makefile.am
index a014c15b3e0..513a3598e5d 100644
--- a/MAC/GCF/Protocols/Makefile.am
+++ b/MAC/GCF/Protocols/Makefile.am
@@ -1,3 +1,12 @@
 SUBDIRS=src
 
+DISTCHECK_CONFIGURE_FLAGS=\
+      --with-common=$(prefix)
+
+EXTRA_DIST = \
+      Makefile.common \
+      GCFProtocols.spec \
+      autoconf_share/compiletool
+
+
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/Protocols/configure.in b/MAC/GCF/Protocols/configure.in
index a2e45f5f860..7553121fc93 100644
--- a/MAC/GCF/Protocols/configure.in
+++ b/MAC/GCF/Protocols/configure.in
@@ -2,10 +2,8 @@ dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
 AC_INIT(src/DH_PIProtocol.h)
-dnl AC_CONFIG_AUX_DIR(config)
-dnl AM_CONFIG_HEADER(config/config.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(GCF/Protocols, 6.0)
+AM_INIT_AUTOMAKE(GCFProtocols, 6.0, no-define)
 
 dnl Initialize for LOFAR (may set compilers)
 lofar_INIT
@@ -23,18 +21,6 @@ AC_PROG_LIBTOOL
 
 dnl Checks for libraries.
 
-dnl dnl Replace `main' with a function in -lfl:
-dnl AC_CHECK_LIB(fl, main)
-dnl dnl Replace `main' with a function in -lcosev_r:
-dnl AC_CHECK_LIB(cosev_r, main)
-dnl dnl Replace `main' with a function in -lcosnm_r:
-dnl AC_CHECK_LIB(cosnm_r, main)
-dnl dnl Replace `main' with a function in -lorb_r:
-dnl AC_CHECK_LIB(orb_r, main)
-dnl dnl Replace `main' with a function in -lpthread:
-dnl AC_CHECK_LIB(pthread, main)
-dnl dnl Replace `main' with a function in -lvport_r:
-dnl AC_CHECK_LIB(vport_r, main)
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -51,7 +37,6 @@ dnl
 dnl Check for LOFAR specific things
 dnl
 lofar_GENERAL
-#lofar_QT
 lofar_INTERNAL(LCS/Common, Common, LCS-Common-2_3, 1,Common/LofarTypes.h,,)
 lofar_INTERNAL(LCS/Transport, transport, LCS-Transport-2_1, 1, Transport/DataHolder.h,,)
 lofar_INTERNAL(MAC/GCF/GCFCommon, GCFCommon, MAC-GCF-6_0, 1,GCF/GCF_Defines.h,,)
@@ -63,4 +48,5 @@ dnl
 AC_OUTPUT(
 src/Makefile
 Makefile
+GCFProtocols.spec
 )
diff --git a/MAC/GCF/TM/GCFTM.spec.in b/MAC/GCF/TM/GCFTM.spec.in
new file mode 100644
index 00000000000..8be2ac5815f
--- /dev/null
+++ b/MAC/GCF/TM/GCFTM.spec.in
@@ -0,0 +1,160 @@
+# -*- Mode:rpm-spec -*-
+# GCFTM.spec.in
+#
+
+##############################################################################
+#
+# Preamble
+#
+##############################################################################
+
+Summary: GCFTM is the common GCF software package providing a set of GCF wide type definitions.
+
+%define release @RPM_RELEASE@
+%define version @VERSION@
+%define pkgname @PACKAGE@
+%define pkgdir %{pkgname}-%{version}-%{release}
+%define prefix /opt/lofar
+%define configure_args @RPM_CONFIGURE_ARGS@
+##define build_kernel_version @BUILD_KERNEL_VERSION@
+
+Name: %{pkgname}
+Version: %{version}
+Release: %{release}
+Copyright: LGPL
+Group: Application/System
+Source: %{pkgname}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{pkgdir}-root
+URL: http://www.astron.nl
+Prefix: %{prefix}
+BuildArchitectures: i386 # Target platforms, i.e., i586
+Requires: Common, GCFCommon 
+Packager: %{packager}
+Distribution: The LOFAR project
+Vendor: ASTRON
+
+AutoReqProv: no
+
+%description
+
+GCFTM is the package handling the data transport in LOFAR.
+
+##############################################################################
+#
+# prep
+#
+##############################################################################
+%prep
+echo $prefix
+
+# create the build directory, untar the source
+%setup
+
+##############################################################################
+#
+# build
+#
+##############################################################################
+%build
+./configure %{configure_args} --prefix=%{prefix} && make
+
+##############################################################################
+#
+# install
+#
+##############################################################################
+%install
+# To make things work with BUILDROOT
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+make DESTDIR="$RPM_BUILD_ROOT" install
+
+#uninstall
+
+##############################################################################
+#
+# verify
+#
+##############################################################################
+#verify
+
+##############################################################################
+#
+# clean
+#
+##############################################################################
+%clean
+# Call me paranoid, but I do not want to be responsible for nuking
+# someone's harddrive!
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+
+##############################################################################
+#
+# files
+#
+##############################################################################
+
+# empty 'files' means all distributed files
+%files
+%defattr(-, root, root)
+%{prefix}
+
+# Your application file list goes here
+# %{prefix}/lib/lib*.so*
+
+# Documentation
+# doc COPYING ChangeLog README AUTHORS NEWS
+# doc doc/*
+
+# link the module to the correct path
+%post 
+
+# before uninstall
+%preun
+
+# after uninstall
+%postun
+
+##############################################################################
+#
+# package devel
+#
+##############################################################################
+
+#package devel
+#Summary: Development files for %{pkgname}
+#Group: Applications/System
+#description devel
+#Development files for %{pkgname}.
+
+#files devel
+
+# Your development files go here
+# Programmers documentation goes here
+#doc doc
+
+# end of file
diff --git a/MAC/GCF/TM/Makefile.am b/MAC/GCF/TM/Makefile.am
index f8ee60a3d5c..ba3651a681e 100644
--- a/MAC/GCF/TM/Makefile.am
+++ b/MAC/GCF/TM/Makefile.am
@@ -1,3 +1,11 @@
-SUBDIRS=autogen src test
+SUBDIRS=autogen src test include
+
+DISTCHECK_CONFIGURE_FLAGS=\
+      --with-common=$(prefix)
+
+EXTRA_DIST = \
+      Makefile.common \
+      GCFTM.spec \
+      autoconf_share/compiletool
 
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/TM/autogen/Makefile.am b/MAC/GCF/TM/autogen/Makefile.am
index 7deea39982e..6ead8de346a 100644
--- a/MAC/GCF/TM/autogen/Makefile.am
+++ b/MAC/GCF/TM/autogen/Makefile.am
@@ -1,4 +1,7 @@
+pkgdatadir = $(datadir)/GCF/TM
 pkgdata_DATA = protocol.tpl
 
+EXTRA_DIST = $(pkgdata_DATA)
+
 include $(top_srcdir)/Makefile.common
 
diff --git a/MAC/GCF/TM/configure.in b/MAC/GCF/TM/configure.in
index d12d7b45ddd..e10735cf971 100644
--- a/MAC/GCF/TM/configure.in
+++ b/MAC/GCF/TM/configure.in
@@ -2,10 +2,8 @@ dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
 AC_INIT(include/GCF/TM/GCF_Event.h)
-dnl AC_CONFIG_AUX_DIR(config)
-dnl AM_CONFIG_HEADER(config/config.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(GCF/TM, 6.0)
+AM_INIT_AUTOMAKE(GCFTM, 6.0, no-define)
 
 dnl Initialize for LOFAR (may set compilers)
 lofar_INIT
@@ -23,19 +21,6 @@ AC_PROG_LIBTOOL
 
 dnl Checks for libraries.
 
-dnl dnl Replace `main' with a function in -lfl:
-dnl AC_CHECK_LIB(fl, main)
-dnl dnl Replace `main' with a function in -lcosev_r:
-dnl AC_CHECK_LIB(cosev_r, main)
-dnl dnl Replace `main' with a function in -lcosnm_r:
-dnl AC_CHECK_LIB(cosnm_r, main)
-dnl dnl Replace `main' with a function in -lorb_r:
-dnl AC_CHECK_LIB(orb_r, main)
-dnl dnl Replace `main' with a function in -lpthread:
-dnl AC_CHECK_LIB(pthread, main)
-dnl dnl Replace `main' with a function in -lvport_r:
-dnl AC_CHECK_LIB(vport_r, main)
-
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(unistd.h)
@@ -51,10 +36,8 @@ dnl
 dnl Check for LOFAR specific things
 dnl
 lofar_GENERAL
-#lofar_QT
-lofar_MPI(0)
 lofar_INTERNAL(LCS/Common, Common, LCS-Common-2_3, 1, Common/LofarTypes.h,,)
-lofar_INTERNAL(MAC/GCF/GCFCommon, GCFCommon, MAC-GCF-6_0, 1, GCF/GCF_Defines.h,,)
+lofar_INTERNAL(MAC/GCF/GCFCommon, GCFCommon, MAC-GCF-6_1, 1, GCF/GCF_Defines.h,,)
 
 dnl
 dnl Output Makefiles
@@ -64,5 +47,8 @@ autogen/Makefile
 src/Makefile
 src/ServiceBroker/Makefile
 test/Makefile
+include/Makefile
+include/GCF/TM/Makefile
 Makefile
+GCFTM.spec
 )
diff --git a/MAC/GCF/TM/include/GCF/TM/Makefile.am b/MAC/GCF/TM/include/GCF/TM/Makefile.am
new file mode 100644
index 00000000000..fe62175cbbd
--- /dev/null
+++ b/MAC/GCF/TM/include/GCF/TM/Makefile.am
@@ -0,0 +1,29 @@
+INSTHDRS =
+
+pkgincludedir = $(includedir)/GCF/TM
+pkginclude_HEADERS = \
+	GCF_ETHRawPort.h \
+	GCF_TCPPort.h \
+	GCF_RawPort.h \
+	GCF_Port.h \
+	GCF_PortInterface.h \
+	GCF_Event.h \
+	GCF_Protocols.h \
+	GCF_Task.h \
+	GCF_Handler.h \
+	GCF_Fsm.h \
+	GCF_Control.h \
+	GCF_DevicePort.h
+
+NOINSTHDRS =
+
+TCCHDRS = 
+
+nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS)
+
+noinst_HEADERS = $(NOINSTHDRS)
+
+DOCHDRS	= $(INSTHDRS) $(NOINSTHDRS)
+
+include $(top_srcdir)/Makefile.common
+
diff --git a/MAC/GCF/TM/include/Makefile.am b/MAC/GCF/TM/include/Makefile.am
new file mode 100644
index 00000000000..d759e2f287f
--- /dev/null
+++ b/MAC/GCF/TM/include/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS	= GCF/TM
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/TM/src/Makefile.am b/MAC/GCF/TM/src/Makefile.am
index 4755e1ed1c3..7a231df48a9 100644
--- a/MAC/GCF/TM/src/Makefile.am
+++ b/MAC/GCF/TM/src/Makefile.am
@@ -5,22 +5,7 @@ SUFFIXES = .ph
 %.ph: ServiceBroker/%.prot
 	$(AUTOGEN) --writable -L $(top_srcdir)/autogen $<
 
-pkgincludedir = $(includedir)/GCF/TM
-pkginclude_HEADERS = \
-	../include/GCF/TM/GCF_ETHRawPort.h \
-	../include/GCF/TM/GCF_TCPPort.h \
-	../include/GCF/TM/GCF_RawPort.h \
-	../include/GCF/TM/GCF_Port.h \
-	../include/GCF/TM/GCF_PortInterface.h \
-	../include/GCF/TM/GCF_Event.h \
-	../include/GCF/TM/GCF_Protocols.h \
-	../include/GCF/TM/GCF_Task.h \
-	../include/GCF/TM/GCF_Handler.h \
-	../include/GCF/TM/GCF_Fsm.h \
-	../include/GCF/TM/GCF_Control.h \
-	../include/GCF/TM/GCF_DevicePort.h
- 
-DOCHDRS = $(pkginclude_HEADERS) \
+DOCHDRS = \
   GTM_Defines.h \
   Timer/GTM_Timer.h \
   Timer/GTM_TimerHandler.h \
@@ -57,15 +42,14 @@ libgcftm_la_SOURCES= $(DOCHDRS) \
   ServiceBroker/GTM_ServiceBroker.cc \
 	SB_Protocol.cc
 
-libgcftm_la_CPPFLAGS=-I$(top_srcdir)/include \
-	-I$(top_srcdir)/src/ServiceBroker
+libgcftm_la_CPPFLAGS=-I$(top_srcdir)/src/ServiceBroker
 
 libgcftm_la_CXXFLAGS=-fmessage-length=0
 
 BUILT_SOURCES =  \
 	SB_Protocol.ph
 
-EXTRA_DIST = $(BUILT_SOURCES)
+EXTRA_DIST = $(BUILT_SOURCES) mac.log_prop.in
 	
 sysconf_DATA = \
 	mac.log_prop
diff --git a/MAC/GCF/TM/src/ServiceBroker/Makefile.am b/MAC/GCF/TM/src/ServiceBroker/Makefile.am
index d42d80d6bb8..bc5dfa63074 100644
--- a/MAC/GCF/TM/src/ServiceBroker/Makefile.am
+++ b/MAC/GCF/TM/src/ServiceBroker/Makefile.am
@@ -7,7 +7,6 @@ noinst_LTLIBRARIES 	= libsb.la
 libsb_la_SOURCES= $(DOCHDRS) \
 	GSB_Controller.cc
 	
-libsb_la_CPPFLAGS= -I$(top_srcdir)/include
 libsb_la_CXXFLAGS=-fmessage-length=0
 
 bin_PROGRAMS   		= ServiceBroker
@@ -19,19 +18,18 @@ ServiceBroker_LDADD		     		= libsb.la $(LOFAR_DEPEND) \
 ServiceBroker_DEPENDENCIES	= libsb.la $(LOFAR_DEPEND) \
 	$(top_builddir)/src/libgcftm.la
 	
-ServiceBroker_CPPFLAGS= -I$(top_srcdir)/include
 ServiceBroker_CXXFLAGS=-fmessage-length=0
 
 BUILT_SOURCES = 
 
-EXTRA_DIST = $(BUILT_SOURCES)
+EXTRA_DIST = $(BUILT_SOURCES) gcf-sb.conf.in
 
 sysconf_DATA= \
 	ServiceBroker.conf
 
 install-data-local:
-	echo "mac.gcf.sb.host=`hostname -s`" >> $(sysconfdir)/ServiceBroker.conf
-	echo "mac.gcf.sb.range1.host=`hostname`" >> $(sysconfdir)/ServiceBroker.conf
+	echo "mac.gcf.sb.host=`hostname -s`" >> $(DESTDIR)$(sysconfdir)/ServiceBroker.conf
+	echo "mac.gcf.sb.range1.host=`hostname`" >> $(DESTDIR)$(sysconfdir)/ServiceBroker.conf
 	
 %.conf: gcf-sb.conf.in
 	cp $< $@
diff --git a/MAC/GCF/TM/test/Makefile.am b/MAC/GCF/TM/test/Makefile.am
index 9ec6d1595ff..41c78fce38a 100644
--- a/MAC/GCF/TM/test/Makefile.am
+++ b/MAC/GCF/TM/test/Makefile.am
@@ -1,11 +1,11 @@
 bin_PROGRAMS 		= tmEcho tmPing
 
-tmEcho_SOURCES 		= Echo.cc Echo_Protocol.cc
+tmEcho_SOURCES 		= Echo.cc Echo_Protocol.cc Echo.h
 tmEcho_LDADD		= ../src/libgcftm.la
 tmEcho_DEPENDENCIES	= ../src/libgcftm.la $(LOFAR_DEPEND)
 tmEcho_CPPFLAGS=-I$(top_srcdir)/include
 
-tmPing_SOURCES 		= Ping.cc Echo_Protocol.cc
+tmPing_SOURCES 		= Ping.cc Echo_Protocol.cc Ping.h
 tmPing_LDADD		= ../src/libgcftm.la
 tmPing_DEPENDENCIES	= ../src/libgcftm.la $(LOFAR_DEPEND)
 tmPing_CPPFLAGS=-I$(top_srcdir)/include
@@ -18,8 +18,7 @@ SUFFIXES = .ph
 BUILT_SOURCES = \
 	Echo_Protocol.ph
 
-EXTRA_DIST = \
-	Echo_Protocol.ph
+EXTRA_DIST = $(BUILT_SOURCES) tm-test.conf.in
 
 sysconf_DATA=\
 	tmEcho.conf \
diff --git a/MAC/GCF/_PAL/GCFPAL.spec.in b/MAC/GCF/_PAL/GCFPAL.spec.in
new file mode 100644
index 00000000000..e043d385456
--- /dev/null
+++ b/MAC/GCF/_PAL/GCFPAL.spec.in
@@ -0,0 +1,160 @@
+# -*- Mode:rpm-spec -*-
+# GCFPAL.spec.in
+#
+
+##############################################################################
+#
+# Preamble
+#
+##############################################################################
+
+Summary: GCFPAL is the common GCF software package providing a set of GCF wide type definitions.
+
+%define release @RPM_RELEASE@
+%define version @VERSION@
+%define pkgname @PACKAGE@
+%define pkgdir %{pkgname}-%{version}-%{release}
+%define prefix /opt/lofar
+%define configure_args @RPM_CONFIGURE_ARGS@
+##define build_kernel_version @BUILD_KERNEL_VERSION@
+
+Name: %{pkgname}
+Version: %{version}
+Release: %{release}
+Copyright: LGPL
+Group: Application/System
+Source: %{pkgname}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{pkgdir}-root
+URL: http://www.astron.nl
+Prefix: %{prefix}
+BuildArchitectures: i386 # Target platforms, i.e., i586
+Requires: Common, GCFCommon, GCFTM, GCFProtocols
+Packager: %{packager}
+Distribution: The LOFAR project
+Vendor: ASTRON
+
+AutoReqProv: no
+
+%description
+
+GCFPAL is the package handling the data transport in LOFAR.
+
+##############################################################################
+#
+# prep
+#
+##############################################################################
+%prep
+echo $prefix
+
+# create the build directory, untar the source
+%setup
+
+##############################################################################
+#
+# build
+#
+##############################################################################
+%build
+./configure %{configure_args} --prefix=%{prefix} && make
+
+##############################################################################
+#
+# install
+#
+##############################################################################
+%install
+# To make things work with BUILDROOT
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+make DESTDIR="$RPM_BUILD_ROOT" install
+
+#uninstall
+
+##############################################################################
+#
+# verify
+#
+##############################################################################
+#verify
+
+##############################################################################
+#
+# clean
+#
+##############################################################################
+%clean
+# Call me paranoid, but I do not want to be responsible for nuking
+# someone's harddrive!
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+
+##############################################################################
+#
+# files
+#
+##############################################################################
+
+# empty 'files' means all distributed files
+%files
+%defattr(-, root, root)
+%{prefix}
+
+# Your application file list goes here
+# %{prefix}/lib/lib*.so*
+
+# Documentation
+# doc COPYING ChangeLog README AUTHORS NEWS
+# doc doc/*
+
+# link the module to the correct path
+%post 
+
+# before uninstall
+%preun
+
+# after uninstall
+%postun
+
+##############################################################################
+#
+# package devel
+#
+##############################################################################
+
+#package devel
+#Summary: Development files for %{pkgname}
+#Group: Applications/System
+#description devel
+#Development files for %{pkgname}.
+
+#files devel
+
+# Your development files go here
+# Programmers documentation goes here
+#doc doc
+
+# end of file
diff --git a/MAC/GCF/_PAL/Makefile.am b/MAC/GCF/_PAL/Makefile.am
index f3d5e75a296..1cc14c6d221 100644
--- a/MAC/GCF/_PAL/Makefile.am
+++ b/MAC/GCF/_PAL/Makefile.am
@@ -1,3 +1,11 @@
-SUBDIRS=SAL PA PML PI
+SUBDIRS=SAL PA PML PI include
+
+DISTCHECK_CONFIGURE_FLAGS=\
+      --with-common=$(prefix)
+
+EXTRA_DIST = \
+      Makefile.common \
+      GCFPAL.spec \
+      autoconf_share/compiletool
 
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/_PAL/PA/Makefile.am b/MAC/GCF/_PAL/PA/Makefile.am
index a014c15b3e0..00a990e3a66 100644
--- a/MAC/GCF/_PAL/PA/Makefile.am
+++ b/MAC/GCF/_PAL/PA/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS=src
+SUBDIRS=src pvss
 
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/_PAL/PA/pvss/Makefile.am b/MAC/GCF/_PAL/PA/pvss/Makefile.am
new file mode 100644
index 00000000000..5b17a1d8c47
--- /dev/null
+++ b/MAC/GCF/_PAL/PA/pvss/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS=panels scripts/libs
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/_PAL/PA/pvss/panels/Makefile.am b/MAC/GCF/_PAL/PA/pvss/panels/Makefile.am
new file mode 100644
index 00000000000..5735f60849e
--- /dev/null
+++ b/MAC/GCF/_PAL/PA/pvss/panels/Makefile.am
@@ -0,0 +1,8 @@
+pkgdatadir = $(datadir)/pvss/panels
+pkgdata_DATA = GCFPATest.pnl \
+	GCFPropSetLoader.pnl
+
+EXTRA_DIST = $(pkgdata_DATA)
+
+include $(top_srcdir)/Makefile.common
+
diff --git a/MAC/GCF/_PAL/PA/pvss/scripts/libs/Makefile.am b/MAC/GCF/_PAL/PA/pvss/scripts/libs/Makefile.am
new file mode 100644
index 00000000000..16dd6430c3a
--- /dev/null
+++ b/MAC/GCF/_PAL/PA/pvss/scripts/libs/Makefile.am
@@ -0,0 +1,10 @@
+pkgdatadir = $(datadir)/pvss/scripts/libs
+pkgdata_DATA = gcfpa-com.ctl \
+	gcfpa-cwd.ctl \
+	gcfpa-prep.ctl \
+	gcfpa-pml.ctl
+
+EXTRA_DIST = $(pkgdata_DATA)
+
+include $(top_srcdir)/Makefile.common
+
diff --git a/MAC/GCF/_PAL/PA/src/Makefile.am b/MAC/GCF/_PAL/PA/src/Makefile.am
index 640abdfdfe0..eb2e50755ad 100644
--- a/MAC/GCF/_PAL/PA/src/Makefile.am
+++ b/MAC/GCF/_PAL/PA/src/Makefile.am
@@ -13,8 +13,7 @@ libpa_la_SOURCES= $(DOCHDRS) \
 	GPA_RequestManager.cc \
 	GPA_Converter.cc
 	
-libpa_la_CPPFLAGS= -I$(top_srcdir)/include \
-	-I$(top_srcdir)/SAL/src
+#libpa_la_CPPFLAGS= -I$(top_srcdir)/SAL/src
 
 bin_PROGRAMS   		= PropertyAgent
   
@@ -25,10 +24,9 @@ PropertyAgent_LDADD		     			= libpa.la $(LOFAR_DEPEND) \
 PropertyAgent_DEPENDENCIES	= libpa.la $(LOFAR_DEPEND) \
 	$(top_builddir)/SAL/src/libsal.la
 	
-PropertyAgent_CPPFLAGS= -I$(top_srcdir)/include \
-	-I$(top_srcdir)/SAL/src
+#PropertyAgent_CPPFLAGS= -I$(top_srcdir)/SAL/src
 
-AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PA\"
+AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PA\" -I$(top_srcdir)/SAL/src
 
 #in case of make install these files will be copied to the bindir beside the test apps
 configfilesdir=$(bindir)
@@ -38,17 +36,11 @@ configfiles_DATA= \
 
 BUILT_SOURCES = 
 
-EXTRA_DIST = $(BUILT_SOURCES)
+EXTRA_DIST = $(BUILT_SOURCES) $(configfiles_DATA) gcf-pa.conf.in 
 
 sysconf_DATA= \
 	PropertyAgent.conf
 
-install-data-local:
-	mkdir -p $(bindir)/pvss/scripts
-	mkdir -p $(bindir)/pvss/panels
-	cp -Rf $(top_srcdir)/PA/pvss/scripts $(bindir)/pvss/
-	cp -Rf $(top_srcdir)/PA/pvss/panels $(bindir)/pvss/
-	
 %.conf: gcf-pa.conf.in
 	cp $< $@
 
diff --git a/MAC/GCF/_PAL/PA/src/preparePVSS-DB b/MAC/GCF/_PAL/PA/src/preparePVSS-DB
index 9f77499b067..b618da12f38 100644
--- a/MAC/GCF/_PAL/PA/src/preparePVSS-DB
+++ b/MAC/GCF/_PAL/PA/src/preparePVSS-DB
@@ -2,7 +2,7 @@
 
 PROJ_PATH=`grep '^proj_path' ${PVSS_II} | sed 's/^.*proj_path *= * "//' | sed 's/".*//'| sed -n '$p' | tail -n 1`
 echo PropertyAgent: Current running PVSS project has been found in $PROJ_PATH
-cp -Rf pvss/* $PROJ_PATH >> /dev/null
+cp -Rf ../share/pvss/* $PROJ_PATH >> /dev/null
 echo PropertyAgent: Prepare DB
 PVSS00ctrl -script libs/gcfpa-prep.ctl -currentproj
 echo PropertyAgent: Start watch-dog in the background
diff --git a/MAC/GCF/_PAL/PI/src/Makefile.am b/MAC/GCF/_PAL/PI/src/Makefile.am
index a9bf3024378..f4b9a60c760 100644
--- a/MAC/GCF/_PAL/PI/src/Makefile.am
+++ b/MAC/GCF/_PAL/PI/src/Makefile.am
@@ -19,8 +19,6 @@ libpi_la_SOURCES= $(DOCHDRS) \
   GPI_PropertySet.cc \
   GPI_TH_Port.cc
 
-libpi_la_CPPFLAGS= -I$(top_srcdir)/include
-	
 bin_PROGRAMS   		= PropertyInterface
   
 PropertyInterface_SOURCES		= GPI_Main.cc
@@ -38,7 +36,7 @@ AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PI\"
 
 BUILT_SOURCES = 
 
-EXTRA_DIST = $(BUILT_SOURCES)
+EXTRA_DIST = $(BUILT_SOURCES) gcf-pi.conf.in
 
 sysconf_DATA= \
 	PropertyInterface.conf
diff --git a/MAC/GCF/_PAL/PML/src/Makefile.am b/MAC/GCF/_PAL/PML/src/Makefile.am
index 1ac95d615e0..3bc5a63a163 100644
--- a/MAC/GCF/_PAL/PML/src/Makefile.am
+++ b/MAC/GCF/_PAL/PML/src/Makefile.am
@@ -1,15 +1,4 @@
-pkgincludedir = $(includedir)/GCF/PAL
-pkginclude_HEADERS = \
-	../../include/GCF/PAL/GCF_ExtProperty.h \
-	../../include/GCF/PAL/GCF_Property.h \
-	../../include/GCF/PAL/GCF_MyProperty.h \
-	../../include/GCF/PAL/GCF_ExtPropertySet.h \
-	../../include/GCF/PAL/GCF_PropertySet.h \
-	../../include/GCF/PAL/GCF_MyPropertySet.h \
-	../../include/GCF/PAL/GCF_Answer.h \
-	../../include/GCF/PAL/GCF_PropertyProxy.h
-	
-DOCHDRS	=	$(pkginclude_HEADERS) \
+DOCHDRS	=	\
 	GPM_Controller.h \
 	GPM_PropertyService.h \
 	GPM_PropertyProxy.h \
@@ -38,14 +27,13 @@ libpml_la_SOURCES= $(DOCHDRS) \
 	GPM_PropertyService.cc \
 	GCF_PropertyProxy.cc
 
-libpml_la_CPPFLAGS= -I$(top_srcdir)/include \
-	-I$(top_srcdir)/SAL/src
+libpml_la_CPPFLAGS= -I$(top_srcdir)/SAL/src
 
 AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PML\"
 	
 BUILT_SOURCES = 
 
-EXTRA_DIST = $(BUILT_SOURCES)
+EXTRA_DIST = $(BUILT_SOURCES) gcf-pml.conf.in
 
 sysconf_DATA= \
 	gcf-pml.conf
diff --git a/MAC/GCF/_PAL/SAL/src/Makefile.am b/MAC/GCF/_PAL/SAL/src/Makefile.am
index f685ab9b6ce..61598575c21 100644
--- a/MAC/GCF/_PAL/SAL/src/Makefile.am
+++ b/MAC/GCF/_PAL/SAL/src/Makefile.am
@@ -1,9 +1,4 @@
-pkginclude_HEADERS = \
-	../../include/GCF/PAL/GCF_PVSSPort.h \
-	../../include/GCF/PAL/GCF_PVSSInfo.h \
-	../../include/GCF/PAL/GCF_SysConnGuard.h
-
-DOCHDRS	=	$(pkginclude_HEADERS) \
+DOCHDRS	=	\
 	GSA_SCADAHandler.h \
 	GSA_PvssApi.h \
 	GSA_Resources.h \
@@ -27,8 +22,6 @@ libsal_la_SOURCES= $(DOCHDRS) \
 	GCF_SysConnGuard.cc \
 	GSA_SysConnGuard.cc
 
-libsal_la_CPPFLAGS= -I$(top_srcdir)/include
-
 AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"SAL\"
 		
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/_PAL/SAL/test/Makefile.am b/MAC/GCF/_PAL/SAL/test/Makefile.am
index 3a228dda853..5200b5dca06 100644
--- a/MAC/GCF/_PAL/SAL/test/Makefile.am
+++ b/MAC/GCF/_PAL/SAL/test/Makefile.am
@@ -1,5 +1,4 @@
-cppflags = -I$(top_srcdir)/SAL/src \
-	-I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/SAL/src
 
 check_PROGRAMS 		= salEcho salPing
 
@@ -8,12 +7,10 @@ TESTS			= #salEcho salPing
 salEcho_SOURCES 			= Echo.cc Service.cc Echo_Protocol.cc
 salEcho_LDADD					= ../src/libsal.la $(LOFAR_DEPEND)
 salEcho_DEPENDENCIES	= ../src/libsal.la $(LOFAR_DEPEND)
-salEcho_CPPFLAGS			= $(cppflags)
 
 salPing_SOURCES 					= Ping.cc  Echo_Protocol.cc
 salPing_LDADD						=  ../src/libsal.la $(LOFAR_DEPEND)
 salPing_DEPENDENCIES			= ../src/libsal.la $(LOFAR_DEPEND)
-salPing_CPPFLAGS= $(cppflags)
 
 AUTOGEN = autogen
 SUFFIXES = .ph
@@ -23,7 +20,7 @@ SUFFIXES = .ph
 BUILT_SOURCES = \
 	Echo_Protocol.ph
 
-EXTRA_DIST = $(BUILT_SOURCES)
+EXTRA_DIST = $(BUILT_SOURCES) sal-test.conf.in
 
 sysconf_DATA= \
 	salEcho.conf \
diff --git a/MAC/GCF/_PAL/configure.in b/MAC/GCF/_PAL/configure.in
index 3db9ca7cc3f..fe058a7bffe 100644
--- a/MAC/GCF/_PAL/configure.in
+++ b/MAC/GCF/_PAL/configure.in
@@ -2,10 +2,8 @@ dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
 AC_INIT(include/GCF/PAL/GCF_Property.h)
-dnl AC_CONFIG_AUX_DIR(config)
-dnl AM_CONFIG_HEADER(config/config.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(GCF/PAL, 6.0)
+AM_INIT_AUTOMAKE(GCFPAL, 6.0, no-define)
 
 dnl Initialize for LOFAR (may set compilers)
 lofar_INIT
@@ -23,19 +21,6 @@ AC_PROG_LIBTOOL
 
 dnl Checks for libraries.
 
-dnl dnl Replace `main' with a function in -lfl:
-dnl AC_CHECK_LIB(fl, main)
-dnl dnl Replace `main' with a function in -lcosev_r:
-dnl AC_CHECK_LIB(cosev_r, main)
-dnl dnl Replace `main' with a function in -lcosnm_r:
-dnl AC_CHECK_LIB(cosnm_r, main)
-dnl dnl Replace `main' with a function in -lorb_r:
-dnl AC_CHECK_LIB(orb_r, main)
-dnl dnl Replace `main' with a function in -lpthread:
-dnl AC_CHECK_LIB(pthread, main)
-dnl dnl Replace `main' with a function in -lvport_r:
-dnl AC_CHECK_LIB(vport_r, main)
-
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(unistd.h)
@@ -51,8 +36,6 @@ dnl
 dnl Check for LOFAR specific things
 dnl
 lofar_GENERAL
-#lofar_QT
-lofar_MPI(0)
 lofar_PVSS(1)
 lofar_INTERNAL(LCS/Common, common, LCS-Common-2_3, 1, Common/LofarTypes.h,,)
 lofar_INTERNAL(LCS/Transport, transport, LCS-Transport-2_1, 1, Transport/DataHolder.h,,)
@@ -67,6 +50,9 @@ dnl Output Makefiles
 dnl
 AC_OUTPUT(
 PA/src/Makefile
+PA/pvss/Makefile
+PA/pvss/panels/Makefile
+PA/pvss/scripts/libs/Makefile
 PA/Makefile
 PI/src/Makefile
 PI/Makefile
@@ -75,5 +61,8 @@ PML/Makefile
 SAL/src/Makefile
 SAL/test/Makefile
 SAL/Makefile
+include/Makefile
+include/GCF/PAL/Makefile
 Makefile
+GCFPAL.spec
 )
diff --git a/MAC/GCF/_PAL/include/GCF/PAL/Makefile.am b/MAC/GCF/_PAL/include/GCF/PAL/Makefile.am
new file mode 100644
index 00000000000..414ec30321f
--- /dev/null
+++ b/MAC/GCF/_PAL/include/GCF/PAL/Makefile.am
@@ -0,0 +1,27 @@
+INSTHDRS =
+
+pkgincludedir = $(includedir)/GCF/PAL
+pkginclude_HEADERS = \
+	GCF_ExtProperty.h \
+	GCF_Property.h \
+	GCF_MyProperty.h \
+	GCF_ExtPropertySet.h \
+	GCF_PropertySet.h \
+	GCF_MyPropertySet.h \
+	GCF_Answer.h \
+	GCF_PropertyProxy.h \
+	GCF_PVSSPort.h \
+	GCF_PVSSInfo.h \
+	GCF_SysConnGuard.h
+	
+NOINSTHDRS =
+
+TCCHDRS = 
+
+nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS)
+
+noinst_HEADERS = $(NOINSTHDRS)
+
+DOCHDRS	= $(INSTHDRS) $(NOINSTHDRS)
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/_PAL/include/Makefile.am b/MAC/GCF/_PAL/include/Makefile.am
new file mode 100644
index 00000000000..1e71b663886
--- /dev/null
+++ b/MAC/GCF/_PAL/include/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS	= GCF/PAL
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/_PALlight/CEP-PMLlight/src/Makefile.am b/MAC/GCF/_PALlight/CEP-PMLlight/src/Makefile.am
index 87a7a2f7fec..058943826e6 100644
--- a/MAC/GCF/_PALlight/CEP-PMLlight/src/Makefile.am
+++ b/MAC/GCF/_PALlight/CEP-PMLlight/src/Makefile.am
@@ -1,9 +1,4 @@
-pkgincludedir = $(includedir)/GCF/PALlight
-pkginclude_HEADERS = \
-	../../include/GCF/PALlight/CEPProperty.h \
-	../../include/GCF/PALlight/CEPPropertySet.h
-	
-DOCHDRS	=	$(pkginclude_HEADERS) \
+DOCHDRS	=	\
   PIClient.h \
   PICEPDefines.h
         
@@ -14,8 +9,6 @@ libceppmllight_la_SOURCES= $(DOCHDRS) \
   CEPPropertySet.cc \
   PIClient.cc
   
-libceppmllight_la_CPPFLAGS= -I$(top_srcdir)/include
-
 lib_LTLIBRARIES 	= libgcfceppallight.la
 
 libgcfceppallight_la_SOURCES=
diff --git a/MAC/GCF/_PALlight/GCFPALlight.spec.in b/MAC/GCF/_PALlight/GCFPALlight.spec.in
new file mode 100644
index 00000000000..674b9b151d0
--- /dev/null
+++ b/MAC/GCF/_PALlight/GCFPALlight.spec.in
@@ -0,0 +1,160 @@
+# -*- Mode:rpm-spec -*-
+# GCFPALlight.spec.in
+#
+
+##############################################################################
+#
+# Preamble
+#
+##############################################################################
+
+Summary: GCFPALlight is the common GCF software package providing a set of GCF wide type definitions.
+
+%define release @RPM_RELEASE@
+%define version @VERSION@
+%define pkgname @PACKAGE@
+%define pkgdir %{pkgname}-%{version}-%{release}
+%define prefix /opt/lofar
+%define configure_args @RPM_CONFIGURE_ARGS@
+##define build_kernel_version @BUILD_KERNEL_VERSION@
+
+Name: %{pkgname}
+Version: %{version}
+Release: %{release}
+Copyright: LGPL
+Group: Application/System
+Source: %{pkgname}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{pkgdir}-root
+URL: http://www.astron.nl
+Prefix: %{prefix}
+BuildArchitectures: i386 # Target platforms, i.e., i586
+Requires: Common, GCFCommon, GCFTM, GCFProtocols, Transport
+Packager: %{packager}
+Distribution: The LOFAR project
+Vendor: ASTRON
+
+AutoReqProv: no
+
+%description
+
+GCFPALlight is the package handling the data transport in LOFAR.
+
+##############################################################################
+#
+# prep
+#
+##############################################################################
+%prep
+echo $prefix
+
+# create the build directory, untar the source
+%setup
+
+##############################################################################
+#
+# build
+#
+##############################################################################
+%build
+./configure %{configure_args} --prefix=%{prefix} && make
+
+##############################################################################
+#
+# install
+#
+##############################################################################
+%install
+# To make things work with BUILDROOT
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+make DESTDIR="$RPM_BUILD_ROOT" install
+
+#uninstall
+
+##############################################################################
+#
+# verify
+#
+##############################################################################
+#verify
+
+##############################################################################
+#
+# clean
+#
+##############################################################################
+%clean
+# Call me paranoid, but I do not want to be responsible for nuking
+# someone's harddrive!
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+
+##############################################################################
+#
+# files
+#
+##############################################################################
+
+# empty 'files' means all distributed files
+%files
+%defattr(-, root, root)
+%{prefix}
+
+# Your application file list goes here
+# %{prefix}/lib/lib*.so*
+
+# Documentation
+# doc COPYING ChangeLog README AUTHORS NEWS
+# doc doc/*
+
+# link the module to the correct path
+%post 
+
+# before uninstall
+%preun
+
+# after uninstall
+%postun
+
+##############################################################################
+#
+# package devel
+#
+##############################################################################
+
+#package devel
+#Summary: Development files for %{pkgname}
+#Group: Applications/System
+#description devel
+#Development files for %{pkgname}.
+
+#files devel
+
+# Your development files go here
+# Programmers documentation goes here
+#doc doc
+
+# end of file
diff --git a/MAC/GCF/_PALlight/Makefile.am b/MAC/GCF/_PALlight/Makefile.am
index a970e099734..2c7ac1f2a57 100644
--- a/MAC/GCF/_PALlight/Makefile.am
+++ b/MAC/GCF/_PALlight/Makefile.am
@@ -1,3 +1,11 @@
-SUBDIRS=PMLlight CEP-PMLlight
+SUBDIRS=PMLlight CEP-PMLlight include
+
+DISTCHECK_CONFIGURE_FLAGS=\
+      --with-common=$(prefix)
+
+EXTRA_DIST = \
+      Makefile.common \
+      GCFPALlight.spec \
+      autoconf_share/compiletool
 
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/_PALlight/PMLlight/src/Makefile.am b/MAC/GCF/_PALlight/PMLlight/src/Makefile.am
index f4c916c5164..78c4804d5f3 100644
--- a/MAC/GCF/_PALlight/PMLlight/src/Makefile.am
+++ b/MAC/GCF/_PALlight/PMLlight/src/Makefile.am
@@ -1,10 +1,4 @@
-pkgincludedir = $(includedir)/GCF/PALlight
-pkginclude_HEADERS = \
-	../../include/GCF/PALlight/GCF_RTMyProperty.h \
-	../../include/GCF/PALlight/GCF_RTMyPropertySet.h \
-	../../include/GCF/PALlight/GCF_RTAnswer.h
-	
-DOCHDRS	=	$(pkginclude_HEADERS) \
+DOCHDRS	=	\
   GPM_RTController.h \
   GPM_RTDefines.h
         
@@ -16,8 +10,6 @@ libpmllight_la_SOURCES= $(DOCHDRS) \
   GCF_RTMyPropertySet.cc \
   GPM_RTController.cc
   
-libpmllight_la_CPPFLAGS= -I$(top_srcdir)/include
-
 lib_LTLIBRARIES 	= libgcfpallight.la
 
 libgcfpallight_la_SOURCES=
@@ -27,6 +19,8 @@ libgcfpallight_la_DEPENDENCIES= libpmllight.la $(LOFAR_DEPEND)
 
 AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"RTC\"
 
+EXTRA_DIST= $(configfiles_DATA) gcf-pmllight.conf.in
+
 sysconf_DATA= \
 	gcf-pmllight.conf
 	
@@ -37,5 +31,4 @@ configfiles_DATA= \
 %.conf: %.conf.in
 	cp $< $@
 
-include $(top_srcdir)/Makefile.common
-
+include $(top_srcdir)/Makefile.common
\ No newline at end of file
diff --git a/MAC/GCF/_PALlight/configure.in b/MAC/GCF/_PALlight/configure.in
index 3d4f51d0a0d..47c0f07efeb 100644
--- a/MAC/GCF/_PALlight/configure.in
+++ b/MAC/GCF/_PALlight/configure.in
@@ -2,10 +2,8 @@ dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
 AC_INIT(include/GCF/PALlight/GCF_RTMyProperty.h)
-dnl AC_CONFIG_AUX_DIR(config)
-dnl AM_CONFIG_HEADER(config/config.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(GCF/PALlight, 6.0)
+AM_INIT_AUTOMAKE(GCFPALlight, 6.0, no-define)
 
 dnl Initialize for LOFAR (may set compilers)
 lofar_INIT
@@ -23,18 +21,6 @@ AC_PROG_LIBTOOL
 
 dnl Checks for libraries.
 
-dnl dnl Replace `main' with a function in -lfl:
-dnl AC_CHECK_LIB(fl, main)
-dnl dnl Replace `main' with a function in -lcosev_r:
-dnl AC_CHECK_LIB(cosev_r, main)
-dnl dnl Replace `main' with a function in -lcosnm_r:
-dnl AC_CHECK_LIB(cosnm_r, main)
-dnl dnl Replace `main' with a function in -lorb_r:
-dnl AC_CHECK_LIB(orb_r, main)
-dnl dnl Replace `main' with a function in -lpthread:
-dnl AC_CHECK_LIB(pthread, main)
-dnl dnl Replace `main' with a function in -lvport_r:
-dnl AC_CHECK_LIB(vport_r, main)
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -51,8 +37,6 @@ dnl
 dnl Check for LOFAR specific things
 dnl
 lofar_GENERAL
-#lofar_QT
-lofar_MPI(0)
 lofar_INTERNAL(LCS/Common, common, LCS-Common-2_3, 1, Common/LofarTypes.h,,)
 lofar_INTERNAL(LCS/Transport, transport, LCS-Transport-2_1, 1, Transport/DataHolder.h,,)
 lofar_INTERNAL(MAC/GCF/GCFCommon, gcfcommon, MAC-GCF-6_0, 1, GCF/GCF_Defines.h,,)
@@ -68,5 +52,8 @@ PMLlight/src/Makefile
 PMLlight/Makefile
 CEP-PMLlight/src/Makefile
 CEP-PMLlight/Makefile
+include/Makefile
+include/GCF/PALlight/Makefile
 Makefile
+GCFPALlight.spec
 )
diff --git a/MAC/GCF/_PALlight/include/GCF/PALlight/Makefile.am b/MAC/GCF/_PALlight/include/GCF/PALlight/Makefile.am
new file mode 100644
index 00000000000..f99ed69bc2b
--- /dev/null
+++ b/MAC/GCF/_PALlight/include/GCF/PALlight/Makefile.am
@@ -0,0 +1,21 @@
+INSTHDRS =
+
+pkgincludedir = $(includedir)/GCF/PALlight
+pkginclude_HEADERS = \
+	GCF_RTMyProperty.h \
+	GCF_RTMyPropertySet.h \
+	GCF_RTAnswer.h \
+	CEPProperty.h \
+	CEPPropertySet.h
+	
+NOINSTHDRS =
+
+TCCHDRS = 
+
+nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS)
+
+noinst_HEADERS = $(NOINSTHDRS)
+
+DOCHDRS	= $(INSTHDRS) $(NOINSTHDRS)
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/GCF/_PALlight/include/Makefile.am b/MAC/GCF/_PALlight/include/Makefile.am
new file mode 100644
index 00000000000..2174ab48865
--- /dev/null
+++ b/MAC/GCF/_PALlight/include/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS	= GCF/PALlight
+
+include $(top_srcdir)/Makefile.common
-- 
GitLab