diff options
-rw-r--r-- | PKGBUILD | 51 | ||||
-rw-r--r-- | strip.pl | 26 |
2 files changed, 63 insertions, 14 deletions
@@ -2,40 +2,57 @@ # Contributor: Brian Bidulock <bidulock@openss7.org> pkgname=opendds-git -pkgver=3.13 -pkgrel=2 +pkgver=3.14 +pkgrel=1 pkgdesc="Open source C++ implementation of OMG Data Distribution Service (DDS)" arch=('i686' 'x86_64') -url="http://www.opendds.org/" +url="https://www.opendds.org/" license=('custom') depends=('perl' 'bash') +provides=('opendds' 'ace' 'tao') +conflicts=('opendds' 'ace' 'tao') options=('!buildflags') makedepends=('git') source=( - "MPC.tar.gz::https://github.com/DOCGroup/MPC/tarball/master" - "ACE_TAO.tar.gz::https://github.com/DOCGroup/ACE_TAO/tarball/master" - "OpenDDS.tar.gz::https://github.com/objectcomputing/OpenDDS/tarball/master" - build.patch - ) -md5sums=('SKIP' - 'SKIP' - 'SKIP' - 'c44b0c8d7ebccc2b9be0a040ec9f8c2b') + "MPC.tar.gz::https://github.com/DOCGroup/MPC/tarball/master" + "ACE_TAO.tar.gz::https://github.com/DOCGroup/ACE_TAO/tarball/master" + "OpenDDS::git+https://github.com/objectcomputing/OpenDDS" + build.patch +) +md5sums=( + 'SKIP' + 'SKIP' + 'SKIP' + 'c44b0c8d7ebccc2b9be0a040ec9f8c2b' +) + +_strip_pl="$(realpath strip.pl)" prepare() { cd "$srcdir" mv DOCGroup-ACE_TAO-* ACE_TAO mv DOCGroup-MPC-* MPC - mv objectcomputing-OpenDDS-* OpenDDS patch --strip=1 -i ../build.patch } +pkgver() { + cd "$srcdir/OpenDDS" + git describe --long | \ + sed 's/\([^-]*-g\)/r\1/;s/^DDS-//g;s/-/./g' | \ + sed 's/^\([0-9]\+\)\.\([0-9]\+\)\.r/\1.\2.0\.r/g' +} + build() { cd "$srcdir/OpenDDS" ./configure \ --mpc="$srcdir/MPC" \ --ace="$srcdir/ACE_TAO/ACE" \ - --tao="$srcdir/ACE_TAO/TAO" + --tao="$srcdir/ACE_TAO/TAO" \ + --configh '#define ACE_LACKS_READDIR_R' \ + --configh '#define ACE_DISABLE_MKTEMP' \ + --configh '#define ACE_DISABLE_TEMPNAM' \ + --no-tests \ + --no-debug make } @@ -43,10 +60,16 @@ package() { cd "$srcdir/OpenDDS" source setenv.sh make INSTALL_PREFIX="/usr" DESTDIR="$pkgdir" install + + # Copy Licences cd "$srcdir" install -Dm644 "$DDS_ROOT/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/OpenDDS_LICENSE" install -Dm644 "$ACE_ROOT/COPYING" "$pkgdir/usr/share/licenses/$pkgname/ACE_TAO_LICENSE" # TODO Other licences + + # Strip $srcdir from Generated Files + cd "$pkgdir" + perl "$_strip_pl" "$srcdir" } # vim:set ts=2 sw=2 et: diff --git a/strip.pl b/strip.pl new file mode 100644 index 000000000000..548a157f8991 --- /dev/null +++ b/strip.pl @@ -0,0 +1,26 @@ +# Strip paths from generated IDL headers that could be installed +use strict; +use warnings; + +use File::Find qw/find/; +use Cwd qw/abs_path/; + +my $srcdir = abs_path($ARGV[0]); +my $srcdir_re = quotemeta($srcdir); + +sub path_func { + my $path = $_; + return if (!-T $path); + open(my $file, "+<$path") or die("Could not open $path: $!"); + my $lines = ""; + while (my $line = <$file>) { + $line =~ s/$srcdir_re\/?//g; + $lines .= $line; + } + seek($file, 0, 0); + print $file $lines; + truncate($file, tell($file)); + close($file); +} + +find({wanted => \&path_func, follow => 0, no_chdir => 1}, abs_path(".")); |