contrib/razor.spec
author J. Ali Harlow <ali@juiblex.co.uk>
Sat Oct 04 18:12:58 2014 +0100 (2014-10-04)
changeset 454 56ff755c268c
parent 242 f2218527ad4a
permissions -rw-r--r--
Only export symbols starting with razor_ in dynamic library.

Apart from being good practice to avoid clashes with higher-level
libraries and the application, this also fixes an obscure bug: The
gnulib library is used both by librazor (the dynamic library) and
by razor (the executable). In doing so, we want to have two separate
copies of the library despite the code duplication this involves.
Without the explicit limit to export only razor_ symbols, the razor
executable under mingw64 was picking up the getopt_long function
from librazor and the optind variable from libgnu which meant that
it did not see optind changing. Hiding librazor's copy of getopt
causes the linker to find libgnu's copy and everything works.

Note that under mingw librazor-#.dll still contains undocumented
(private) razor_ symbols but these will do no harm as long as nobody
tries to use them.
rhughes@242
     1
Summary:   Razor is a package management system replacing rpm and yum
rhughes@242
     2
Name:      razor
rhughes@242
     3
Version:   0.1
rhughes@242
     4
Release:   0.1%{?dist}
rhughes@242
     5
License:   GPLv2+
rhughes@242
     6
Group:     System Environment/Libraries
rhughes@242
     7
URL:       http://github.com/krh/razor/wikis
rhughes@242
     8
Source0:   http://people.freedesktop.org/~krh/releases/%{name}-%{version}.tar.gz
rhughes@242
     9
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
rhughes@242
    10
rhughes@242
    11
Requires: expat
rhughes@242
    12
Requires: rpm-libs
rhughes@242
    13
rhughes@242
    14
BuildRequires: expat-devel
rhughes@242
    15
BuildRequires: libtool
rhughes@242
    16
BuildRequires: gettext
rhughes@242
    17
BuildRequires: libcurl-devel
rhughes@242
    18
BuildRequires: rpm-devel
rhughes@242
    19
BuildRequires: zlib-devel
rhughes@242
    20
BuildRequires: perl(XML::Parser)
rhughes@242
    21
rhughes@242
    22
%description
rhughes@242
    23
Razor is a package management system replacing rpm and yum.
rhughes@242
    24
Razor implements management of packages installed on the system,
rhughes@242
    25
dependency solving, and upgrading in a small compact code base with
rhughes@242
    26
minimal dependencies.
rhughes@242
    27
rhughes@242
    28
%package libs
rhughes@242
    29
Summary: Libraries for accessing razor
rhughes@242
    30
Group: Development/Libraries
rhughes@242
    31
Requires: expat >= %{dbus_version}
rhughes@242
    32
Requires: %{name} = %{version}-%{release}
rhughes@242
    33
rhughes@242
    34
%description libs
rhughes@242
    35
Libraries for accessing razor.
rhughes@242
    36
rhughes@242
    37
%package devel
rhughes@242
    38
Summary: Libraries and headers for razor
rhughes@242
    39
Group: Development/Libraries
rhughes@242
    40
Requires: %{name} = %{version}-%{release}
rhughes@242
    41
Requires: pkgconfig
rhughes@242
    42
Requires: libcurl-devel
rhughes@242
    43
Requires: rpm-devel
rhughes@242
    44
Requires: zlib-devel
rhughes@242
    45
rhughes@242
    46
%description devel
rhughes@242
    47
Headers and libraries for razor.
rhughes@242
    48
rhughes@242
    49
%prep
rhughes@242
    50
%setup -q
rhughes@242
    51
rhughes@242
    52
%build
rhughes@242
    53
%configure
rhughes@242
    54
rhughes@242
    55
make %{?_smp_mflags}
rhughes@242
    56
rhughes@242
    57
%install
rhughes@242
    58
rm -rf $RPM_BUILD_ROOT
rhughes@242
    59
make install DESTDIR=$RPM_BUILD_ROOT
rhughes@242
    60
rhughes@242
    61
rm -f $RPM_BUILD_ROOT%{_libdir}/librazor*.a
rhughes@242
    62
rm -f $RPM_BUILD_ROOT%{_libdir}/librazor*.la
rhughes@242
    63
rhughes@242
    64
#%find_lang %name
rhughes@242
    65
rhughes@242
    66
%clean
rhughes@242
    67
rm -rf $RPM_BUILD_ROOT
rhughes@242
    68
rhughes@242
    69
%post libs -p /sbin/ldconfig
rhughes@242
    70
rhughes@242
    71
%postun libs -p /sbin/ldconfig
rhughes@242
    72
rhughes@242
    73
%files
rhughes@242
    74
# -f %{name}.lang
rhughes@242
    75
%defattr(-,root,root,-)
rhughes@242
    76
%doc README AUTHORS NEWS COPYING
rhughes@242
    77
%dir %{_datadir}/doc/razor
rhughes@242
    78
%doc %{_datadir}/doc/razor/*.txt
rhughes@242
    79
%config %{_sysconfdir}/bash_completion.d/*.sh
rhughes@242
    80
%{_bindir}/razor
rhughes@242
    81
%exclude %{_libdir}/librazor*.so.*
rhughes@242
    82
rhughes@242
    83
%files libs
rhughes@242
    84
%defattr(-,root,root,-)
rhughes@242
    85
%doc README AUTHORS NEWS COPYING
rhughes@242
    86
%{_libdir}/*razor*.so.*
rhughes@242
    87
rhughes@242
    88
%files devel
rhughes@242
    89
%defattr(-,root,root,-)
rhughes@242
    90
rhughes@242
    91
%{_libdir}/lib*.so
rhughes@242
    92
%{_libdir}/pkgconfig/*
rhughes@242
    93
%{_includedir}/*
rhughes@242
    94
rhughes@242
    95
%changelog
rhughes@242
    96
* Mon Jun 16 2008 Richard Hughes <richard@hughsie.com> 0.1-0.1
rhughes@242
    97
- Initial version
rhughes@242
    98