diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | Pull requests |Archive | README | LICENSE

OBS.md (5253B)


      1 # Documentation for OBS Builds
      2 The OBS project [`home:in0rdr`](https://build.opensuse.org/project/show/home:in0rdr)
      3 comprises following `diary` packages:
      4 * `diary`: Latest stable release built from tar.gz statically placed in the source
      5 * `diary-nightly`: Latest unstable build, re-built sporadically (manual action)
      6   from the code on the master branch
      7 
      8 > ℹ️ `diary-nightly` is not branched from `diary`, it has a completely separate
      9 > build config.
     10 
     11 Additionally, these packages are being used as dependency for `diary-nightly`,
     12 to download the latest diary source code from the master branch:
     13 * [`openSUSE:Tools/obs-service-tar_scm`](https://github.com/openSUSE/obs-service-tar_scm):
     14   Use `obs_scm` to fetch latest sources
     15 * [`openSUSE:Tools/obs-service-recompress`](https://github.com/openSUSE/obs-service-recompress):
     16   Re-compress downloaded source files
     17 * [`openSUSE:Tools/obs-service-set_version`](https://github.com/openSUSE/obs-service-set_version):
     18   Set dynamic version based on information (`.obsinfo` file) from the Git checkout
     19 
     20 ## OBS Project Configuration
     21 ```
     22 # Fix "have choice for libzstd.so.1()(64bit) needed by rpm-build: libzstd libzstd1"
     23 # https://en.opensuse.org/openSUSE:Build_Service_prjconf#Prefer
     24 Prefer: libzstd
     25 ```
     26 
     27 ## OBS Project Meta
     28 Fix CentOS-8 builds that miss python3 dependencies (obs-service-set_version) by
     29 adding the OpenSUSE Tools to the CentOS-8 repos:
     30 
     31 ```
     32 <repository name="CentOS_8_Stream">
     33   <path project="CentOS:CentOS-8:Stream" repository="standard"/>
     34   <path project="openSUSE:Tools" repository="CentOS_8"/>
     35   <arch>x86_64</arch>
     36   <arch>aarch64</arch>
     37 </repository>
     38 <repository name="CentOS_8">
     39   <path project="CentOS:CentOS-8" repository="standard"/>
     40   <path project="openSUSE:Tools" repository="CentOS_8"/>
     41   <arch>x86_64</arch>
     42   <arch>aarch64</arch>
     43 </repository>
     44 ```
     45 
     46 Source:
     47 https://forums.opensuse.org/t/nothing-provides-obs-service-tar-nothing-provides-obs-service-recompress-in-most-distros/141901/12
     48 
     49 ## OBS Source Services (`obs-service-`) Documentation
     50 The documentation on how to use source services is sparse and scattered:
     51 
     52 * https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.source_service.html
     53 * https://github.com/openSUSE/obs-service-tar_scm/issues/238
     54 * https://github.com/openSUSE/obs-service-tar_scm/issues/223
     55 * https://build.opensuse.org/package/view_file/OBS:Server:Unstable/obs-service-tar_scm/\_service?expand=1
     56 
     57 The purpose of the source services and how they are used for the
     58 `diary-nightly` build (dependencies) is documented below.
     59 
     60 ### `openSUSE:Tools/obs-service-tar_scm`
     61 A recent (`obs-service-tar_scm-0.10.46.tar.gz`) fork should build fine for the
     62 most relevant distros.
     63 
     64 ### `openSUSE:Tools/obs-service-recompress`
     65 https://github.com/openSUSE/obs-service-recompress
     66 
     67 Branched package from
     68 [`openSUSE:Tools/obs-service-recompress`](https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-recompress).
     69 
     70 If this package is not made available in the local project `home:in0rdr`,
     71 following error message will occur:
     72 ```
     73 nothing provides obs-service-recompress
     74 ```
     75 
     76 No further modifications needed, but needs to be available for the
     77 `diary-nightly` for compression services:
     78 ```bash
     79 # home:in0rdr/diary-nightly/_service
     80 <services>
     81   <service mode="buildtime" name="recompress">
     82     <param name="file">*.tar</param>
     83     <param name="compression">gz</param>
     84   </service>
     85 ...
     86 </services>
     87 ```
     88 
     89 This service is used in combination with the service
     90 [`tar_scm`](https://github.com/openSUSE/obs-service-tar_scm).
     91 
     92 ### `openSUSE:Tools/obs-service-set_version`
     93 This service sets the version in the RPM spec or Debian changelog according to
     94 the latest downloaded source files:
     95 https://github.com/openSUSE/obs-service-set_version
     96 
     97 ### `openSUSE:Factory/zstd` OBS Package
     98 > ℹ️ This OBS package is not strictly required (no branching needed) with
     99 > `tar.gz` compression in the source service (`_service`).
    100 
    101 Patch `zstd.spec`, such that RHEL build require `glibc-static` and openSUSE
    102 builds require `glibc-devel-static`:
    103 ```diff
    104 - BuildRequires:  (glibc-static or glibc-devel-static)
    105 + %if 0%{?rhel} || 0%{?fedora}
    106 + BuildRequires:  glibc-static
    107 + %else
    108 + BuildRequires:  glibc-devel-static
    109 + %endif
    110 ```
    111 
    112 ## `zstd` Compression in the ArchLinux PKGBUILD
    113 If `diary-nightly` for ArchLinux is built with `tar.gz` compression, the build
    114 will not be shown on the [download page](https://software.opensuse.org//download.html?project=home%3Ain0rdr&package=diary-nightly)
    115 and the download button for ArchLinux is missing, see also:
    116 * https://github.com/in0rdr/diary/issues/64
    117 * https://github.com/openSUSE/software-o-o/issues/844
    118 * https://github.com/openSUSE/open-build-service/pull/10570
    119 * https://archlinux.org/news/now-using-zstandard-instead-of-xz-for-package-compression
    120 
    121 Therefore, build the ArchLinux package with the `.pkg.tar.zst` extension/compression:
    122 
    123 ```
    124 # ./diary-nightly/PKGBUILD
    125 PKGEXT='.pkg.tar.zst'
    126 ```
    127 
    128 If the ZST compression (new defacto standard since
    129 [2020-01-04](https://archlinux.org/news/now-using-zstandard-instead-of-xz-for-package-compression))
    130 does not work, use the xz compression as an alternative as described in
    131 [openSUSE/software-o-o/#844](https://github.com/openSUSE/software-o-o/issues/844):
    132 
    133 ```
    134 PKGEXT='.pkg.tar.xz'
    135 ```