#223 Add syntax highlighting to specfile code blocks in Packaging: EPEL-specific guidelines
Merged a year ago by tdawson. Opened a year ago by ferdnyc.
ferdnyc/epel epel-highlight  into  main

@@ -103,7 +103,8 @@ 

  no existing `+%post+` or `+%postun+` scriptlets, simply include the

  `+%ldconfig_scriptlets+` macro on its own line before the %files list.

  

- ....

+ [source, rpm-spec]

+ ----

  [...]

  %install

  # Install the program
@@ -113,7 +114,7 @@ 

  %files libs

  %license GPL

  [...]

- ....

+ ----

  

  Using the `+%ldconfig_scriptlets+` macro will automatically generate a

  dependency on ldconfig where necessary. The macro will do nothing at all
@@ -150,7 +151,8 @@ 

  /usr/bin/glib-compile-schemas must be run whenever the set of installed

  schemas changes.

  

- ....

+ [source, rpm-spec]

+ ----

  %postun

  if [ $1 -eq 0 ] ; then

      /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
@@ -158,7 +160,7 @@ 

  

  %posttrans

      /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :

- ....

+ ----

  

  [[gdk_pixbuf_loaders]]

  == gdk-pixbuf loaders
@@ -177,7 +179,8 @@ 

  

  The scriptlets to maintain the cache file are:

  

- ....

+ [source, rpm-spec]

+ ----

  %postun

      /usr/bin/gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache &> /dev/null || :

  
@@ -186,7 +189,7 @@ 

      # For upgrades, the cache will be regenerated by the new package's %postun

      /usr/bin/gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache &> /dev/null || :

  fi

- ....

+ ----

  

  Note the use of %\{__isa_bits}, which is an rpm macro that expands to

  either 32 or 64, depending on the architecture of the package.
@@ -206,7 +209,8 @@ 

  

  The scriptlets to maintain the cache file are:

  

- ....

+ [source, rpm-spec]

+ ----

  %postun

  /usr/bin/gtk-query-immodules-3.0-%{__isa_bits} --update-cache &> /dev/null || :

  
@@ -215,7 +219,7 @@ 

      # For upgrades, the cache will be regenerated by the new package's %postun

      /usr/bin/gtk-query-immodules-3.0-%{__isa_bits} --update-cache &> /dev/null || :

  fi

- ....

+ ----

  

  The 3.0 in the binary name is there because gtk2 has its own utility for

  the same purpose, called gtk-query-immodules-2.0. Note the use of
@@ -238,7 +242,8 @@ 

  

  The scriptlets to maintain the cache file are:

  

- ....

+ [source, rpm-spec]

+ ----

  %postun

  /usr/bin/gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules &> /dev/null || :

  
@@ -246,7 +251,7 @@ 

  # We run this after every install or upgrade because of a cornercase

  # when installing the second architecture of a multilib package

  /usr/bin/gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules || :

- ....

+ ----

  

  Note the use of %\{__isa_bits}, which is an rpm macro that expands to

  either 32 or 64, depending on the architecture of the package.
@@ -255,7 +260,8 @@ 

  

  Use this when a package drops an XML file in %\{_datadir}/mime/packages.

  

- ....

+ [source, rpm-spec]

+ ----

  %post

  /bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :

  
@@ -266,7 +272,7 @@ 

  

  %posttrans

  /usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :

- ....

+ ----

  

  Note that similarly to the gtk-update-icon-cache code, these scriptlets

  should be run only if the user has update-mime-info installed and
@@ -280,22 +286,24 @@ 

  

  Use this when a desktop entry has a *MimeType* key.

  

- ....

+ [source, rpm-spec]

+ ----

  %post

  /usr/bin/update-desktop-database &> /dev/null || :

  

  %postun

  /usr/bin/update-desktop-database &> /dev/null || :

- ....

+ ----

  

  Note: This scriptlet follows the same convention as mimeinfo files and

  gtk-icon-cache. Namely, the spec file should not Require

  desktop-file-utils for this. For older releases, one should

  

- ....

+ [source, rpm-spec]

+ ----

  Requires(post): desktop-file-utils

  Requires(postun): desktop-file-utils

- ....

+ ----

  

  (See http://bugzilla.redhat.com/180898 and

  http://bugzilla.redhat.com/180899)
@@ -325,7 +333,8 @@ 

  versions or (very) trimmed down installations, and generally results in

  less entries in specfiles, rpmdb, and repo metadatas.

  

- ....

+ [source, rpm-spec]

+ ----

  %post

  /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

  
@@ -337,4 +346,4 @@ 

  

  %posttrans

  /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

- ....

+ ----

no initial comment

LGTM
Verified that it works.

Pull-Request has been merged by tdawson

a year ago
Metadata