diff --git a/.gitignore b/.gitignore index d2a361f..d250df1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -gpsd-2.95.tar.gz +/gpsd-3.0.tar.gz diff --git a/gpsd-2.95-gpscatnoarg.patch b/gpsd-2.95-gpscatnoarg.patch deleted file mode 100644 index 10455e0..0000000 --- a/gpsd-2.95-gpscatnoarg.patch +++ /dev/null @@ -1,66 +0,0 @@ -From ba90cdad2cc759e2b5ebb91fa374e57a868f142c Mon Sep 17 00:00:00 2001 -From: Miroslav Lichvar -Date: Mon, 13 Sep 2010 15:16:17 +0200 -Subject: [PATCH 1/2] Don't crash in gpscat when started without arguments. - ---- - gpscat | 9 ++++++++- - 1 files changed, 8 insertions(+), 1 deletions(-) - -diff --git a/gpscat b/gpscat -index f51cacb..1fe98dd 100755 ---- a/gpscat -+++ b/gpscat -@@ -31,6 +31,9 @@ def reporter(errlevel, msg): - if errlevel <= debuglevel: - sys.stdout.write(msg) - -+def printusage(): -+ sys.stderr.write("usage: gpscat [-s speed] serial-port\n") -+ - if __name__ == '__main__': - buf = "" - try: -@@ -60,9 +63,13 @@ if __name__ == '__main__': - elif switch == '-D': - debuglevel = BASELEVEL + int(val) - elif switch == '-h': -- sys.stderr.write("usage: gpscat [-s speed] serial-port\n") -+ printusage() - raise SystemExit, 0 - -+ if (len(arguments) != 1): -+ printusage() -+ raise SystemExit, 1 -+ - if "rfcomm" in arguments[0]: # Bluetooth special case - s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM) - s.connect((arguments[0], 1)) --- -1.7.2 - -From 65a5b756eff38741cdb41851f8a2eaeaae1a0094 Mon Sep 17 00:00:00 2001 -From: Miroslav Lichvar -Date: Mon, 13 Sep 2010 15:19:00 +0200 -Subject: [PATCH 2/2] Update gpscat usage text. - ---- - gpscat | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/gpscat b/gpscat -index 1fe98dd..9e02084 100755 ---- a/gpscat -+++ b/gpscat -@@ -32,7 +32,7 @@ def reporter(errlevel, msg): - sys.stdout.write(msg) - - def printusage(): -- sys.stderr.write("usage: gpscat [-s speed] serial-port\n") -+ sys.stderr.write("usage: gpscat [-s speed] [-p] [-t] [-D debuglevel] serial-port\n") - - if __name__ == '__main__': - buf = "" --- -1.7.2 - diff --git a/gpsd-2.95-hotplugvars.patch b/gpsd-2.95-hotplugvars.patch deleted file mode 100644 index 410a882..0000000 --- a/gpsd-2.95-hotplugvars.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -up gpsd-2.95/gpsd.hotplug.wrapper.hotplugvars gpsd-2.95/gpsd.hotplug.wrapper ---- gpsd-2.95/gpsd.hotplug.wrapper.hotplugvars 2010-07-12 02:40:22.000000000 +0200 -+++ gpsd-2.95/gpsd.hotplug.wrapper 2010-07-15 16:48:08.000000000 +0200 -@@ -3,20 +3,25 @@ - # This file is Copyright (c) 2010 by the GPSD project - # BSD terms apply: see the file COPYING in the distribution root for details. - -+PATH=/usr/sbin:$PATH -+export PATH -+ - if [ -r /etc/default/gpsd ]; then - . /etc/default/gpsd - elif [ -r /etc/sysconfig/gpsd ]; then - . /etc/sysconfig/gpsd -+ GPSD_OPTIONS=$OPTIONS -+ GPSD_SOCKET=$CONTROL_SOCKET - fi - --if [ -n $GPSD_OPTIONS ]; then -+if [ -n "$GPSD_OPTIONS" ]; then - export GPSD_OPTIONS - fi --if [ -n $GPSD_SOCKET ]; then -+if [ -n "$GPSD_SOCKET" ]; then - export GPSD_SOCKET - fi - --if [ -n $USBAUTO ]; then -+if [ -n "$USBAUTO" ]; then - [ "$USBAUTO" = "true" ] || exit 0 - fi - diff --git a/gpsd-2.95-silentmake.patch b/gpsd-2.95-silentmake.patch deleted file mode 100644 index e626398..0000000 --- a/gpsd-2.95-silentmake.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up gpsd-2.95/setup.py.silentmake gpsd-2.95/setup.py ---- gpsd-2.95/setup.py.silentmake 2010-06-11 10:38:24.000000000 +0200 -+++ gpsd-2.95/setup.py 2010-07-14 17:23:12.000000000 +0200 -@@ -57,7 +57,7 @@ if not 'clean' in sys.argv: - gpspacket_sources = ["gpspacket.c", "packet.c", "isgps.c", - "driver_rtcm2.c", "strl.c", "hex.c", "crc24q.c"] - include_dirs = [ os.path.realpath(os.path.dirname(__file__)) ] --version_out = os.popen(MAKE + " -s version") -+version_out = os.popen(MAKE + " --no-print-directory version") - version = version_out.read() - print(version) - if version_out.close(): diff --git a/gpsd-scons.patch b/gpsd-scons.patch new file mode 100644 index 0000000..30b9215 --- /dev/null +++ b/gpsd-scons.patch @@ -0,0 +1,54 @@ +diff -up gpsd-3.0/SConstruct.scons gpsd-3.0/SConstruct +--- gpsd-3.0/SConstruct.scons 2011-08-19 07:36:28.000000000 +0200 ++++ gpsd-3.0/SConstruct 2011-08-22 16:35:20.763702823 +0200 +@@ -155,7 +155,7 @@ for i in ["AR", "ARFLAGS", "CCFLAGS", "C + j = i + if i == "LD": + i = "SHLINK" +- env[j]=os.getenv(i) ++ env[j]=Split(os.getenv(i)) + for flags in ["LDFLAGS", "CPPFLAGS"]: + if os.environ.has_key(flags): + env.MergeFlags([os.getenv(flags)]) +@@ -194,14 +194,12 @@ def installdir(dir): + + # Honor the specified installation prefix in link paths. + env.Prepend(LIBPATH=[os.path.join(env['prefix'], installdir('libdir'))]) +-env.Prepend(RPATH=[os.path.join(env['prefix'], installdir('libdir'))]) + + # Tell generated binaries to look in the current directory for + # shared libraries. Should be handled sanely by scons on all systems. + # Not good to use '.' or a relative path here; it's a security risk. + # At install time we should use chrpath to edit this out of RPATH. + env.Prepend(LIBPATH=[os.path.realpath(os.curdir)]) +-env.Prepend(RPATH=[os.path.realpath(os.curdir)]) + + # Give deheader a way to set compiler flags + if 'MORECFLAGS' in os.environ: +@@ -217,8 +215,7 @@ env.SourceCode('.', None) + + # Should we build with debug symbols? + if env['debug']: +- env.Append(CCFLAGS=['-g']) +- env.Append(CCFLAGS=['-O0']) ++ pass + else: + env.Append(CCFLAGS=['-O2']) + +@@ -383,6 +380,7 @@ if config.CheckExecutable('$CHRPATH -v', + have_chrpath = True + else: + have_chrpath = False ++have_chrpath = False + + # Map options to libraries required to support them that might be absent. + optionrequires = { +@@ -822,7 +820,7 @@ if st != 0: + from datetime import datetime + rev = datetime.now().isoformat()[:-4] + revision='#define REVISION "%s"\n' %(rev.strip(),) +-env.NoClean(env.Textfile(target="revision.h", source=[revision])) ++#env.NoClean(env.Textfile(target="revision.h", source=[revision])) + + generated_sources = ['packet_names.h', 'timebase.h', 'gpsd.h', "ais_json.i", + 'gps_maskdump.c', 'ais_json.c', 'revision.h'] diff --git a/gpsd.spec b/gpsd.spec index c0c166c..728bcd9 100644 --- a/gpsd.spec +++ b/gpsd.spec @@ -1,6 +1,6 @@ Name: gpsd -Version: 2.95 -Release: 7%{?dist} +Version: 3.0 +Release: 1%{?dist} Summary: Service daemon for mediating access to a GPS Group: System Environment/Daemons @@ -9,16 +9,15 @@ URL: http://developer.berlios.de/projects/gpsd/ Source0: http://download.berlios.de/gpsd/%{name}-%{version}.tar.gz Source10: gpsd.service Source11: gpsd.sysconfig -Patch0: gpsd-2.95-silentmake.patch -Patch1: gpsd-2.95-hotplugvars.patch -Patch2: gpsd-2.95-gpscatnoarg.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# fix RPATH, CFLAGS and revision.h +Patch0: gpsd-scons.patch BuildRequires: dbus-devel dbus-glib-devel ncurses-devel xmlto python-devel +BuildRequires: scons desktop-file-utils bluez-libs-devel %ifnarch s390 s390x BuildRequires: libusb1-devel %endif -BuildRequires: desktop-file-utils Requires: %{name}-libs = %{version}-%{release} Requires: udev @@ -73,24 +72,32 @@ can run on a serial terminal or terminal emulator. %prep %setup -q -%patch0 -p1 -b .silentmake -%patch1 -p1 -b .hotplugvars -%patch2 -p1 -b .gpscatnoarg +%patch0 -p1 -b .scons + +echo '#define REVISION "release-%{version}-%{release}"' > revision.h %build -%configure \ - --enable-dbus \ - --disable-libQgpsmm \ - --disable-static -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool - -make %{?_smp_mflags} +export CFLAGS="%{optflags}" +# fails with %{_smp_mflags} +scons \ + dbus=yes \ + systemd=yes \ + libQgpsmm=no \ + debug=yes \ + prefix="" \ + sysconfdif=%{_sysconfdir} \ + bindir=%{_bindir} \ + includedir=%{_includedir} \ + libdir=%{_libdir} \ + sbindir=%{_sbindir} \ + mandir=%{_mandir} \ + docdir=%{_docdir} \ + build %install rm -rf %{buildroot} -make DESTDIR=%{buildroot} pythondir=%{python_sitearch} install +DESTDIR=%{buildroot} scons install # service files %{__install} -d -m 0755 %{buildroot}/lib/systemd/system @@ -108,13 +115,7 @@ make DESTDIR=%{buildroot} pythondir=%{python_sitearch} install # hotplug script %{__install} -d -m 0755 %{buildroot}/lib/udev -%{__install} -p -m 0755 gpsd.hotplug gpsd.hotplug.wrapper %{buildroot}/lib/udev - -# remove .la files -rm -f %{buildroot}%{_libdir}/libgps*.la - -# fix non-executable python script -%{__chmod} +x %{buildroot}%{python_sitearch}/gps/gps.py +%{__install} -p -m 0755 gpsd.hotplug %{buildroot}/lib/udev # Install the .desktop files desktop-file-install --vendor fedora \ @@ -130,6 +131,8 @@ desktop-file-install --vendor fedora \ %{__install} -d -m 0755 %{buildroot}%{_datadir}/gpsd %{__install} -p -m 0644 packaging/X11/gpsd-logo.png %{buildroot}%{_datadir}/gpsd/gpsd-logo.png +# Not needed since gpsd.h is not installed +rm %{buildroot}%{_libdir}/{libgpsd.so,pkgconfig/libgpsd.pc} %clean rm -rf %{buildroot} @@ -161,12 +164,14 @@ fi %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/udev/rules.d/* %{_sbindir}/gpsd +%{_sbindir}/gpsdctl %{_bindir}/gpsprof %{_bindir}/gpsmon %{_bindir}/gpsctl /lib/systemd/system/gpsd.service /lib/udev/gpsd* %{_mandir}/man8/gpsd.8* +%{_mandir}/man8/gpsdctl.8* %{_mandir}/man1/gpsprof.1* %{_mandir}/man1/gpsmon.1* %{_mandir}/man1/gpsctl.1* @@ -186,17 +191,18 @@ fi %{python_sitearch}/gps/fake* %{_includedir}/gps.h %{_includedir}/libgpsmm.h -%{_includedir}/gpsd.h %{_mandir}/man1/gpsfake.1* %{_mandir}/man3/libgps.3* +%{_mandir}/man3/libQgpsmm.3* %{_mandir}/man3/libgpsmm.3* %{_mandir}/man3/libgpsd.3* -%{_mandir}/man5/rtcm-104.5* +%{_mandir}/man5/gpsd_json.5* %{_mandir}/man5/srec.5* %files clients %defattr(-,root,root,-) %{_bindir}/cgps +%{_bindir}/gegps %{_bindir}/gpscat %{_bindir}/gpsdecode %{_bindir}/gpspipe @@ -204,6 +210,7 @@ fi %{_bindir}/lcdgps %{_bindir}/xgps %{_bindir}/xgpsspeed +%{_mandir}/man1/gegps.1* %{_mandir}/man1/gps.1* %{_mandir}/man1/gpsdecode.1* %{_mandir}/man1/gpspipe.1* diff --git a/sources b/sources index 727574f..67e348b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -12535a9ed9fecf9ea2c5bdc9840da5ae gpsd-2.95.tar.gz +c63d41a26868e9bdd48d9e311a9cc42c gpsd-3.0.tar.gz