#1 Move the library into a separate package
Merged 4 months ago by rjones. Opened 4 months ago by mcoleman.
https://github.com/iammattcoleman/package_hivex.git separate-library-package  into  rawhide

Move the library into a separate package: hivex-libs
Matt Coleman • 4 months ago  
hivex.spec
file modified
+31 -8
@@ -10,7 +10,7 @@

  

  Name:           hivex

  Version:        1.3.20

- Release:        5%{?dist}

+ Release:        6%{?dist}

  Summary:        Read and write Windows Registry binary hive files

  

  License:        LGPLv2
@@ -64,6 +64,11 @@

  %endif

  BuildRequires: make

  

+ Requires:       %{name}-libs = %{version}-%{release}

+ 

+ Conflicts:      %{name} < 1.3.20-6

+ Obsoletes:      %{name} < 1.3.20-6

+ 

  # https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Packages_granted_exceptions

  Provides:      bundled(gnulib)

  
@@ -99,9 +104,19 @@

  For Ruby bindings, see 'ruby-hivex'.

  

  

+ %package libs

+ Summary:        Library for %{name}

+ Conflicts:      %{name} < 1.3.20-6

+ Obsoletes:      %{name} < 1.3.20-6

+ 

+ 

+ %description libs

+ %{name}-libs contains the library for %{name}.

+ 

+ 

  %package devel

  Summary:        Development tools and libraries for %{name}

- Requires:       %{name} = %{version}-%{release}

+ Requires:       %{name}-libs = %{version}-%{release}

  Requires:       pkgconfig

  

  
@@ -113,7 +128,7 @@

  %if !0%{?rhel}

  %package static

  Summary:        Statically linked library for %{name}

- Requires:       %{name} = %{version}-%{release}

+ Requires:       %{name}-libs = %{version}-%{release}

  

  

  %description static
@@ -125,7 +140,7 @@

  %if %{with ocaml}

  %package -n ocaml-%{name}

  Summary:       OCaml bindings for %{name}

- Requires:      %{name} = %{version}-%{release}

+ Requires:      %{name}-libs = %{version}-%{release}

  

  

  %description -n ocaml-%{name}
@@ -149,7 +164,7 @@

  

  %package -n perl-%{name}

  Summary:       Perl bindings for %{name}

- Requires:      %{name} = %{version}-%{release}

+ Requires:      %{name}-libs = %{version}-%{release}

  Requires:      perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

  

  
@@ -159,7 +174,7 @@

  

  %package -n python3-%{name}

  Summary:       Python 3 bindings for %{name}

- Requires:      %{name} = %{version}-%{release}

+ Requires:      %{name}-libs = %{version}-%{release}

  

  %description -n python3-%{name}

  python3-%{name} contains Python 3 bindings for %{name}.
@@ -167,7 +182,7 @@

  

  %package -n ruby-%{name}

  Summary:       Ruby bindings for %{name}

- Requires:      %{name} = %{version}-%{release}

+ Requires:      %{name}-libs = %{version}-%{release}

  Requires:      ruby(release)

  Requires:      ruby

  Provides:      ruby(hivex) = %{version}
@@ -242,12 +257,17 @@

  %{_bindir}/hivexget

  %{_bindir}/hivexml

  %{_bindir}/hivexsh

- %{_libdir}/libhivex.so.*

  %{_mandir}/man1/hivexget.1*

  %{_mandir}/man1/hivexml.1*

  %{_mandir}/man1/hivexsh.1*

  

  

+ %files libs

+ %doc README

+ %license LICENSE

+ %{_libdir}/libhivex.so.*

+ 

+ 

  %files devel

  %license LICENSE

  %{_libdir}/libhivex.so
@@ -303,6 +323,9 @@

  

  

  %changelog

+ * Fri Jun 11 2021 Matt Coleman <matt@datto.com> - 1.3.20-6

+ - Move the library into a separate package: hivex-libs

+ 

  * Fri Jun 11 2021 Matt Coleman <matt@datto.com> - 1.3.20-5

  - Mark LICENSE as a license file

  

Use separate packages for the tools and the library, according to Fedora's packaging guidelines.

rebased onto 8a866ca

4 months ago

The rebase was because I had forgotten to increment Release in the spec file.

Do you need the Conflicts and Obsoletes lines? The first set (on "%{name}) shouldn't really be necessary since a package doesn't need to conflict or obsolete an earlier version of itself. The second set (on %{name}-libs) seems more plausible, but the -libs package will conflict on the main package anyway (because it has the same files). Obsoleting is dubious because if you installed the newer %{name}-libs it would remove %{name} (the tools) which may or may not be what you want.

I would drop all Conflicts and Obsoletes lines unless there's a good reason.

I pushed just the %license change for now. You might get a conflict around the %changelog lines but it should be easy to resolve.

Do you need the Conflicts and Obsoletes lines? The first set (on "%{name}) shouldn't really be necessary since a package doesn't need to conflict or obsolete an earlier version of itself. The second set (on %{name}-libs) seems more plausible, but the -libs package will conflict on the main package anyway (because it has the same files). Obsoleting is dubious because if you installed the newer %{name}-libs it would remove %{name} (the tools) which may or may not be what you want.

I would drop all Conflicts and Obsoletes lines unless there's a good reason.

When doing package splitting, you need to do that to guarantee that DNF does the right thing.

Otherwise, you can randomly hit file conflicts on upgrade.

rebased onto 15c827f

4 months ago

I resolved the conflicts and pushed a new version with just the libs package commit.

rebased onto b14f3a8

4 months ago

The most recent rebase fixes the release number on the Conflicts and Obsoletes lines.

@rjones According to @ngompa, Conflicts and Obsoletes are needed on both in order to correctly handle package splits, so that's what I did.

Pull-Request has been merged by rjones

4 months ago
Metadata