test/zsh.spec
author J. Ali Harlow <ali@juiblex.co.uk>
Fri Oct 03 15:05:33 2014 +0100 (2014-10-03)
changeset 453 1fd1d221092d
parent 393 d16ac3fb05fa
permissions -rw-r--r--
Add INTLLIBS back into librazor_la_LIBADD and also into razor.pc

INTLLIBS was originally added into librazor_la_LIBADD (but not razor.pc)
in 611c84a3f4b4538a65d186050608c17adbf17770 and then removed in
236cfc8ecc5c66288e41bf9b72051a3b18326e1c over concerns that it meant
that building static applications (eg., in plover) required a static
version of libintl. Since then, however, the inclusion of gnulib's
getopt has caused the build to fail without INTLLIBS in librazor_la_LIBADD
with messages of the form:

../gl/.libs/libgnu.a(getopt.o): In function `_getopt_internal_r':
/home/ali/wk/razor/vpath/gl/../../working/gl/getopt.c:808: undefined reference to `libintl_gettext'

while building librazor.dll.a

Thus it appears that INTLLIBS really is needed and should go back into
librazor_la_LIBADD (which fixes the build) and should also be in Libs.private
in razor.pc for static builds. This means that a static version of libintl
will be required (eg., as part of mingw64-gettext-static).

Along the way, razor.pc has also been fixed to avoid overlinking
(https://wiki.openmandriva.org/en/Overlinking_issues_in_packaging)
and a missing include directory that caused the razor executable to
fail to build was added.
ali@393
     1
%define _source_payload w9.gzdio
ali@393
     2
%define _binary_payload w9.gzdio
ali@393
     3
ali@351
     4
Name:      zsh
ali@351
     5
Summary:   Test package
ali@351
     6
Group:     Test
ali@351
     7
License:   GPL
ali@351
     8
Version:   1
ali@351
     9
Release:   1
ali@351
    10
Source:    zsh.tar
ali@351
    11
BuildArch: noarch
ali@351
    12
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ali@351
    13
Prefix:    /usr
ali@351
    14
Requires:  zip
ali@418
    15
Requires(pre,postun):  zip
ali@351
    16
ali@351
    17
%description
ali@351
    18
Test package
ali@351
    19
ali@351
    20
%prep
ali@351
    21
ali@351
    22
%build
ali@351
    23
ali@351
    24
%install
ali@351
    25
mkdir -p $RPM_BUILD_ROOT/usr/bin
ali@351
    26
mkdir -p $RPM_BUILD_ROOT/etc
ali@351
    27
touch $RPM_BUILD_ROOT/usr/bin/zsh
ali@363
    28
echo "DEVICE /dev/tty" > $RPM_BUILD_ROOT/etc/zsh.conf
ali@351
    29
ali@351
    30
%clean
ali@351
    31
ali@367
    32
%pre -p <lua>
ali@367
    33
function mkdir_missing(dir)
ali@367
    34
    if posix.stat(dir)==nil then
ali@367
    35
	posix.mkdir(dir)
ali@367
    36
    end
ali@367
    37
end
ali@367
    38
prefix=posix.getenv("RPM_INSTALL_PREFIX0")
ali@367
    39
if prefix==nil then
ali@367
    40
    prefix="/usr"
ali@367
    41
end
ali@376
    42
if arg[2]==1 and posix.stat(prefix.."/bin/zip")~=nil then
ali@367
    43
    mkdir_missing(prefix.."/var")
ali@367
    44
    mkdir_missing(prefix.."/var/lib")
ali@367
    45
    posix.mkdir(prefix.."/var/lib/zsh")
ali@367
    46
    io.output(prefix.."/var/lib/zsh/data.zip")
ali@367
    47
    io.write("Important data\n");
ali@367
    48
    io.close()
ali@367
    49
end
ali@367
    50
ali@367
    51
%postun -p <lua>
ali@367
    52
prefix=posix.getenv("RPM_INSTALL_PREFIX0")
ali@367
    53
if prefix==nil then
ali@367
    54
    prefix="/usr"
ali@367
    55
end
ali@376
    56
if arg[2]==0 and posix.stat(prefix.."/bin/zip")~=nil then
ali@367
    57
    os.remove(prefix.."/var/lib/zsh/data.zip")
ali@367
    58
    os.remove(prefix.."/var/lib/zsh")
ali@367
    59
end
ali@367
    60
ali@351
    61
%files
ali@351
    62
/usr/bin/zsh
ali@351
    63
/etc/zsh.conf