Ticket #3751: 3751-0005-extfs-rpm-add-test-for-a-custom-package.patch

File 3751-0005-extfs-rpm-add-test-for-a-custom-package.patch, 17.5 KB (added by mooffie, 7 years ago)
  • tests/src/vfs/extfs/helpers-list/Makefile.am

    From e3d0928d7d7ab84e2f2aa8aefe2174b25d671cbb Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Thu, 5 Jan 2017 14:09:00 +0200
    Subject: [PATCH 1/2] Ticket #3751: extfs: rpm: add test for a custom package.
    
    We use a 'spec' contributed by Jiri Tyr.
    
    We keep the previous test (by renaming rpm.* to rpm.glib.*), though, in case
    somebody wants to work on data from "the real world".
    
    Signed-off-by: Mooffie <mooffie@gmail.com>
    ---
     tests/src/vfs/extfs/helpers-list/Makefile.am       |   9 +-
     tests/src/vfs/extfs/helpers-list/data/rpm.README   |  20 +-
     .../data/{rpm.env_vars => rpm.custom.env_vars}     |   0
     .../vfs/extfs/helpers-list/data/rpm.custom.input   | 260 +++++++++++++++++++++
     .../vfs/extfs/helpers-list/data/rpm.custom.output  |  28 +++
     .../vfs/extfs/helpers-list/data/rpm.glib.env_vars  |   4 +
     .../data/{rpm.input => rpm.glib.input}             |   0
     .../data/{rpm.output => rpm.glib.output}           |   0
     tests/src/vfs/extfs/helpers-list/misc/Makefile.am  |   2 +-
     tests/src/vfs/extfs/helpers-list/misc/test.spec    |  85 +++++++
     10 files changed, 399 insertions(+), 9 deletions(-)
     rename tests/src/vfs/extfs/helpers-list/data/{rpm.env_vars => rpm.custom.env_vars} (100%)
     create mode 100644 tests/src/vfs/extfs/helpers-list/data/rpm.custom.input
     create mode 100644 tests/src/vfs/extfs/helpers-list/data/rpm.custom.output
     create mode 100644 tests/src/vfs/extfs/helpers-list/data/rpm.glib.env_vars
     rename tests/src/vfs/extfs/helpers-list/data/{rpm.input => rpm.glib.input} (100%)
     rename tests/src/vfs/extfs/helpers-list/data/{rpm.output => rpm.glib.output} (100%)
     create mode 100644 tests/src/vfs/extfs/helpers-list/misc/test.spec
    
    diff --git a/tests/src/vfs/extfs/helpers-list/Makefile.am b/tests/src/vfs/extfs/helpers-list/Makefile.am
    index cc29adf..ef74ffb 100644
    a b data_files_to_distribute = \ 
    3939        data/lslR.3.spaces-iso-noslash.output \ 
    4040        data/lslR.README \ 
    4141        data/rpm.README \ 
    42         data/rpm.env_vars \ 
    43         data/rpm.input \ 
    44         data/rpm.output \ 
     42        data/rpm.custom.env_vars \ 
     43        data/rpm.custom.input \ 
     44        data/rpm.custom.output \ 
     45        data/rpm.glib.env_vars \ 
     46        data/rpm.glib.input \ 
     47        data/rpm.glib.output \ 
    4548        data/rpm.rewrite.sh \ 
    4649        data/u7z.README \ 
    4750        data/u7z.complex.env_vars \ 
  • tests/src/vfs/extfs/helpers-list/data/rpm.README

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.README b/tests/src/vfs/extfs/helpers-list/data/rpm.README
    index e08e324..78c55bc 100644
    a b  
    11 
    2 The *.input files for the rpm helper are what we call "tags files". 
    3 They're generated by rpm2tags. 
     2The *.input files for the tests are what we call "tags files". They are 
     3generated by rpm2tags. 
    44 
    5 The rpm package chosen was glib2-2.46.2-4.el7.i686.rpm (downloadable from 
    6 rpmfind.net), as it has scriptlets that demonstrate the INFO/SCRIPTS dir. 
     5The tests: 
     6 
     7- rpm.glib.input: 
     8 
     9  Generated from glib2-2.46.2-4.el7.i686.rpm (downloadable from 
     10  rpmfind.net). 
     11 
     12- rpm.custom.input: 
     13 
     14  Generated from our own custom package (see test.spec in this 
     15  distribution). The advantage of this custom package is that it lets us 
     16  test the helper with almost all the tags it's supposed to support. 
    717 
    818-- 
    919 
    10 The way this test works is a bit unconventional: 
     20The way we test this helper is a bit unconventional: 
    1121 
    1222We aren't overriding one or two variables in the helper but, instead, 
    1323inject a code snippet into it (see 'rpm.rewrite.sh'). This lets us 
  • new file tests/src/vfs/extfs/helpers-list/data/rpm.custom.input

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.env_vars b/tests/src/vfs/extfs/helpers-list/data/rpm.custom.env_vars
    similarity index 100%
    rename from tests/src/vfs/extfs/helpers-list/data/rpm.env_vars
    rename to tests/src/vfs/extfs/helpers-list/data/rpm.custom.env_vars
    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.custom.input b/tests/src/vfs/extfs/helpers-list/data/rpm.custom.input
    new file mode 100644
    index 0000000..505ca06
    - +  
     1# -*- Perl -*- 
     2# 
     3# This "tags file" was created by running the following command: 
     4# 
     5#    $ rpm2tags ~/rpmbuild/RPMS/noarch/test-2.3-4.noarch.rpm 
     6# 
     7# This file is used in our tests instead of the corresponding RPM file. 
     8# This lets us run the tests on systems where 'rpm' is not installed. 
     9 
     10$tags = { 
     11  'PROVIDEVERSION' => '1:2.3-4', 
     12  'PATCHESNAME' => '(none)', 
     13  'REQUIREFLAGS' => '288', 
     14  'NAME' => 'test', 
     15  'FILEDEPENDSN' => '0', 
     16  'POSTTRANS' => 'echo "Post-transaction script"', 
     17  'SUGGESTNEVRS' => '(none)', 
     18  'CONFLICTFLAGS' => '0', 
     19  'VERIFYSCRIPT' => 'echo "Verify script"', 
     20  '_INFO' => 'Name        : test 
     21Epoch       : 1 
     22Version     : 2.3 
     23Release     : 4 
     24Architecture: noarch 
     25Install Date: (not installed) 
     26Group       : Development/System 
     27Size        : 5 
     28License     : MIT 
     29Signature   : (none) 
     30Source RPM  : test-2.3-4.src.rpm 
     31Build Date  : Thu Jan  5 13:46:18 2017 
     32Build Host  : mooffie-desktop 
     33Relocations : (not relocatable) 
     34Packager    : Test Packager 
     35Vendor      : Test Vendor 
     36URL         : http://example.com 
     37Summary     : Testing 
     38Description : 
     39Multi-line description field 
     40with "double", \'single quotes\', and $weird | \\characters i\\n = i\\\\t, empty line... 
     41 
     42...and a tab: [ ]. 
     43', 
     44  'DBINSTANCE' => '0', 
     45  'FILECOLORS' => '0', 
     46  'POSTUNFLAGS' => '(none)', 
     47  'POLICYTYPESINDEXES' => '(none)', 
     48  'PACKAGER' => 'Test Packager', 
     49  'SIGSIZE' => '2408', 
     50  'PREINPROG' => '/bin/sh', 
     51  'CLASSDICT' => 'ASCII text', 
     52  'FILEINODES' => '1', 
     53  'EXCLUSIVEARCH' => '(none)', 
     54  'ICON' => '(none)', 
     55  'OBSOLETEFLAGS' => '0', 
     56  'CHANGELOGNAME' => 'Jiri Tyr <jiri.tyr at gmail.com> 1:2.3-4', 
     57  'V' => '2.3', 
     58  'VERIFYSCRIPTFLAGS' => '(none)', 
     59  'SUPPLEMENTFLAGS' => '(none)', 
     60  'FILECLASS' => 'ASCII text', 
     61  'COOKIE' => '(none)', 
     62  'OLDENHANCESNAME' => '(none)', 
     63  'FILEDEPENDSX' => '0', 
     64  'ORDERNAME' => '(none)', 
     65  'TRIGGERSCRIPTS' => '(none)', 
     66  'OLDFILENAMES' => '(none)', 
     67  'PAYLOADFORMAT' => 'cpio', 
     68  'CHANGELOGTIME' => '1483099200', 
     69  'DIRINDEXES' => '0', 
     70  'OLDENHANCESVERSION' => '(none)', 
     71  'OLDENHANCES' => '(none)', 
     72  'SIZE' => '5', 
     73  'SUMMARY' => 'Testing', 
     74  'POLICYFLAGS' => '(none)', 
     75  'SOURCERPM' => 'test-2.3-4.src.rpm', 
     76  'OBSOLETEVERSION' => '', 
     77  'FILEUSERNAME' => 'root', 
     78  'EPOCH' => '1', 
     79  'ORIGDIRNAMES' => '(none)', 
     80  'LICENSE' => 'MIT', 
     81  'OLDSUGGESTS' => '(none)', 
     82  'PATCHESVERSION' => '(none)', 
     83  'FILEMD5S' => 'd8e8fca2dc0f896fd7cb4cb0031ba249', 
     84  'POLICIES' => '(none)', 
     85  'DSAHEADER' => '(none)', 
     86  'LONGSIGSIZE' => '2408', 
     87  'ENHANCENEVRS' => '(none)', 
     88  'ENHANCEFLAGS' => '(none)', 
     89  'PROVIDENEVRS' => 'test = 1:2.3-4', 
     90  'OLDSUGGESTSFLAGS' => '(none)', 
     91  'NVRA' => 'test-2.3-4.noarch', 
     92  'TRIGGERINDEX' => '(none)', 
     93  'HEADERI18NTABLE' => 'C', 
     94  'PATCHESFLAGS' => '(none)', 
     95  'BUILDARCHS' => '(none)', 
     96  'ENHANCEVERSION' => '(none)', 
     97  'REQUIREFLAGS:depflags' => '', 
     98  'RECOMMENDS' => '(none)', 
     99  'VERSION' => '2.3', 
     100  'FILELINKTOS' => '', 
     101  'CONFLICTNEVRS' => 'notest', 
     102  'OBSOLETENEVRS' => 'testing', 
     103  'E' => '1', 
     104  'CHANGELOGTEXT' => '- Initial build.', 
     105  'PRETRANSFLAGS' => '(none)', 
     106  'REQUIRENAME' => '/bin/sh', 
     107  'HEADERREGIONS' => '(none)', 
     108  'NOPATCH' => '(none)', 
     109  'FILEREQUIRE' => '', 
     110  'BUILDTIME' => '1483616778', 
     111  'FILEFLAGS' => '0', 
     112  'OLDSUGGESTSVERSION' => '(none)', 
     113  'PROVIDEFLAGS' => '8', 
     114  'O' => 'testing', 
     115  'SHA1HEADER' => '94826dbc4976a5c54a494a0591553b972edcf235', 
     116  'ARCHIVESIZE' => '264', 
     117  'FILENAMES' => '/var/tmp/test.txt', 
     118  'FILERDEVS' => '0', 
     119  'INSTALLCOLOR' => '(none)', 
     120  'REQUIRENEVRS' => '/bin/sh', 
     121  'FILEDIGESTS' => 'd8e8fca2dc0f896fd7cb4cb0031ba249', 
     122  'EXCLUSIVEOS' => '(none)', 
     123  'CHANGELOGTIME:date' => 'Fri Dec 30 14:00:00 2016', 
     124  'PREFIXES' => '(none)', 
     125  'POLICYNAMES' => '(none)', 
     126  'FILEVERIFYFLAGS' => '4294967295', 
     127  'TRIGGERNAME' => '(none)', 
     128  'PROVIDES' => 'test', 
     129  'RELEASE' => '4', 
     130  'SOURCEPACKAGE' => '(none)', 
     131  'FSCONTEXTS' => '(none)', 
     132  'GROUP' => 'Development/System', 
     133  'HDRID' => '94826dbc4976a5c54a494a0591553b972edcf235', 
     134  'SOURCEPKGID' => '(none)', 
     135  'SUGGESTVERSION' => '(none)', 
     136  'SIGGPG' => '(none)', 
     137  'FILELANGS' => '', 
     138  'ORDERFLAGS' => '(none)', 
     139  'GIF' => '(none)', 
     140  'OBSOLETES' => 'testing', 
     141  'REQUIREVERSION' => '', 
     142  'PAYLOADFLAGS' => '9', 
     143  'TRIGGERTYPE' => '(none)', 
     144  'REMOVETID' => '(none)', 
     145  'OBSOLETEFLAGS:depflags' => '', 
     146  'FILEMTIMES' => '1483616778', 
     147  'POSTUN' => 'echo "Post-uninstallation script"', 
     148  'PROVIDEFLAGS:depflags' => '=', 
     149  'POSTINPROG' => '/bin/sh', 
     150  'OLDSUGGESTSNAME' => '(none)', 
     151  'BUGURL' => '(none)', 
     152  'INSTALLTIME' => '(none)', 
     153  'PREINFLAGS' => '(none)', 
     154  'LONGARCHIVESIZE' => '264', 
     155  'ENHANCES' => '(none)', 
     156  'VENDOR' => 'Test Vendor', 
     157  'URL' => 'http://example.com', 
     158  'RSAHEADER' => '(none)', 
     159  'VCS' => '(none)', 
     160  'POSTTRANSPROG' => '/bin/sh', 
     161  'TRIGGERVERSION' => '(none)', 
     162  'ORIGBASENAMES' => '(none)', 
     163  'TRIGGERFLAGS' => '(none)', 
     164  'RECOMMENDFLAGS' => '(none)', 
     165  'ARCH' => 'noarch', 
     166  'SUGGESTFLAGS' => '(none)', 
     167  'OS' => 'linux', 
     168  'PREUNPROG' => '/bin/sh', 
     169  'P' => 'test', 
     170  'SUPPLEMENTNAME' => '(none)', 
     171  'CONFLICTFLAGS:depflags' => '', 
     172  'DEPENDSDICT' => '(none)', 
     173  'PREUNFLAGS' => '(none)', 
     174  'PLATFORM' => 'noarch-debian-linux', 
     175  'DIRNAMES' => '/var/tmp/', 
     176  'POSTTRANSFLAGS' => '(none)', 
     177  'NVR' => 'test-2.3-4', 
     178  'SIGPGP' => '(none)', 
     179  'INSTFILENAMES' => '(none)', 
     180  'CONFLICTS' => 'notest', 
     181  'NEVRA' => 'test-1:2.3-4.noarch', 
     182  'RECONTEXTS' => '(none)', 
     183  'NEVR' => 'test-1:2.3-4', 
     184  'REQUIRES' => '/bin/sh', 
     185  'PATCH' => '(none)', 
     186  'SOURCE' => '(none)', 
     187  'LONGSIZE' => '5', 
     188  'FILECAPS' => '(none)', 
     189  'DISTURL' => '(none)', 
     190  'RECOMMENDVERSION' => '(none)', 
     191  'FILEMODES' => '33188', 
     192  'BUILDHOST' => 'mooffie-desktop', 
     193  'PUBKEYS' => '(none)', 
     194  'PREUN' => 'echo "Pre-uninstallation script"', 
     195  'FILEPROVIDE' => '', 
     196  'OPTFLAGS' => '-O2 -g -march=i386 -mtune=i686', 
     197  'ORIGFILENAMES' => '(none)', 
     198  'CONFLICTNAME' => 'notest', 
     199  'TRIGGERSCRIPTFLAGS' => '(none)', 
     200  'TRIGGERCONDS' => '(none)', 
     201  'HEADERIMAGE' => '(none)', 
     202  'SUPPLEMENTVERSION' => '(none)', 
     203  'BASENAMES' => 'test.txt', 
     204  'SUPPLEMENTS' => '(none)', 
     205  'SUGGESTS' => '(none)', 
     206  'PREIN' => 'echo "Pre-installation script"', 
     207  'OLDENHANCESFLAGS' => '(none)', 
     208  'DESCRIPTION' => 'Multi-line description field 
     209with "double", \'single quotes\', and $weird | \\characters i\\n = i\\\\t, empty line... 
     210 
     211...and a tab: [ ].', 
     212  'FILESTATES' => '(none)', 
     213  'CONFLICTVERSION' => '', 
     214  'PROVIDENAME' => 'test', 
     215  'HEADERCOLOR' => '0', 
     216  'FILECONTEXTS' => '(none)', 
     217  'EPOCHNUM' => '1', 
     218  'LONGFILESIZES' => '5', 
     219  'DISTRIBUTION' => 'Test Distro', 
     220  'SUGGESTNAME' => '(none)', 
     221  'RPMVERSION' => '4.12.0.1', 
     222  'POLICYTYPES' => '(none)', 
     223  'HEADERSIGNATURES' => '(none)', 
     224  'VERBOSE' => '(none)', 
     225  'R' => '4', 
     226  'PKGID' => 'e8150d00f05b3becbc59c4a31becfab6', 
     227  'NOSOURCE' => '(none)', 
     228  'EXCLUDEARCH' => '(none)', 
     229  'FILEDIGESTALGO' => '(none)', 
     230  'N' => 'test', 
     231  'RECOMMENDNAME' => '(none)', 
     232  'FILESIZES' => '5', 
     233  'FILEDEVICES' => '1', 
     234  'EXCLUDEOS' => '(none)', 
     235  'C' => 'notest', 
     236  'PRETRANSPROG' => '/bin/sh', 
     237  'PRETRANS' => 'echo "Pre-transaction script"', 
     238  'ORIGDIRINDEXES' => '(none)', 
     239  'FILENLINKS' => '1', 
     240  'TRIGGERSCRIPTPROG' => '(none)', 
     241  'VERIFYSCRIPTPROG' => '/bin/sh', 
     242  'OBSOLETENAME' => 'testing', 
     243  'RECOMMENDNEVRS' => '(none)', 
     244  'POSTINFLAGS' => '(none)', 
     245  'BUILDTIME:date' => 'Thu Jan  5 13:46:18 2017', 
     246  'SIGMD5' => 'e8150d00f05b3becbc59c4a31becfab6', 
     247  'SUPPLEMENTNEVRS' => '(none)', 
     248  'FILEGROUPNAME' => 'root', 
     249  'POSTUNPROG' => '/bin/sh', 
     250  'INSTPREFIXES' => '(none)', 
     251  'ORDERVERSION' => '(none)', 
     252  'XPM' => '(none)', 
     253  'INSTALLTID' => '(none)', 
     254  'POSTIN' => 'echo "Post-installation script"', 
     255  'DISTTAG' => '(none)', 
     256  'PAYLOADCOMPRESSOR' => 'gzip', 
     257  'ENHANCENAME' => '(none)', 
     258  'EVR' => '1:2.3-4' 
     259} 
     260; 
  • new file tests/src/vfs/extfs/helpers-list/data/rpm.custom.output

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.custom.output b/tests/src/vfs/extfs/helpers-list/data/rpm.custom.output
    new file mode 100644
    index 0000000..b2f56db
    - +  
     1-r--r--r--   1        0        0        539 2017-01-05 00:00:00 HEADER 
     2-r-xr-xr-x   1        0        0         39 2017-01-05 00:00:00 INSTALL 
     3-r-xr-xr-x   1        0        0         39 2017-01-05 00:00:00 UPGRADE 
     4dr-xr-xr-x   3        0        0          0 2017-01-05 00:00:00 INFO 
     5-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/NAME-EPOCH:VERSION-RELEASE 
     6-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/GROUP 
     7-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/BUILDHOST 
     8-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SOURCERPM 
     9-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/BUILDTIME 
     10-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/RPMVERSION 
     11-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/OS 
     12-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SIZE 
     13-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/DISTRIBUTION 
     14-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/VENDOR 
     15-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/DESCRIPTION 
     16-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/PREIN 
     17-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/POSTIN 
     18-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/PREUN 
     19-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/POSTUN 
     20-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/VERIFYSCRIPT 
     21-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/ALL 
     22-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/PREINPROG 
     23-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/POSTINPROG 
     24-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/PREUNPROG 
     25-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/POSTUNPROG 
     26-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/SCRIPTS/VERIFYSCRIPTPROG 
     27-r--r--r--   1        0        0          0 2017-01-05 00:00:00 INFO/CHANGELOG 
     28-r--r--r--   1        0        0          0 2017-01-05 00:00:00 CONTENTS.cpio 
  • new file tests/src/vfs/extfs/helpers-list/data/rpm.glib.env_vars

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.glib.env_vars b/tests/src/vfs/extfs/helpers-list/data/rpm.glib.env_vars
    new file mode 100644
    index 0000000..c08b141
    - +  
     1MC_TEST_INPUT="$INPUT"   # export it. 
     2MC_TEST_RPM_REWRITE="$DATA_DIR/rpm.rewrite.sh" 
     3 
     4MCFASTRPM=               # disable "fast mode". 
  • tests/src/vfs/extfs/helpers-list/misc/Makefile.am

    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.input b/tests/src/vfs/extfs/helpers-list/data/rpm.glib.input
    similarity index 100%
    rename from tests/src/vfs/extfs/helpers-list/data/rpm.input
    rename to tests/src/vfs/extfs/helpers-list/data/rpm.glib.input
    diff --git a/tests/src/vfs/extfs/helpers-list/data/rpm.output b/tests/src/vfs/extfs/helpers-list/data/rpm.glib.output
    similarity index 100%
    rename from tests/src/vfs/extfs/helpers-list/data/rpm.output
    rename to tests/src/vfs/extfs/helpers-list/data/rpm.glib.output
    diff --git a/tests/src/vfs/extfs/helpers-list/misc/Makefile.am b/tests/src/vfs/extfs/helpers-list/misc/Makefile.am
    index b05f611..8361ecc 100644
    a b  
    11 
    2 EXTRA_DIST = rpm2tags 
     2EXTRA_DIST = rpm2tags test.spec 
  • new file tests/src/vfs/extfs/helpers-list/misc/test.spec

    diff --git a/tests/src/vfs/extfs/helpers-list/misc/test.spec b/tests/src/vfs/extfs/helpers-list/misc/test.spec
    new file mode 100644
    index 0000000..3708b77
    - +  
     1# 
     2# This spec file is used to build the test*.rpm package we use in one of 
     3# our tests. 
     4# 
     5# The advantage of using our own custom package, instead of downloading a 
     6# random one from the net, is that we get the chance here to define all the 
     7# tags our rpm helper is supposed to support. 
     8# 
     9# Build this package with: 
     10# 
     11#    $ rpmbuild -bb test.spec 
     12# 
     13# Then create the input for the test with: 
     14# 
     15#    $ /path/to/rpm2tags ~/rpmbuild/RPMS/noarch/test*.rpm > rpm.custom.input 
     16# 
     17Name:           test 
     18Summary:        Testing 
     19Epoch:          1 
     20Version:        2.3 
     21Release:        4%{?dist} 
     22URL:            http://example.com 
     23Group:          Development/System 
     24License:        MIT 
     25BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root 
     26BuildArch:      noarch 
     27Conflicts:      notest 
     28Obsoletes:      testing 
     29Distribution:   Test Distro 
     30Packager:       Test Packager 
     31Vendor:         Test Vendor 
     32 
     33 
     34%description 
     35Multi-line description field 
     36with "double", 'single quotes', and $weird | \characters i\n = i\\t, empty line... 
     37 
     38...and a tab: [ ]. 
     39 
     40%install 
     41[ "%{buildroot}" != / ] && %{__rm} -rf "%{buildroot}" 
     42%{__mkdir_p} %{buildroot}%{_tmppath} 
     43echo %{name} > %{buildroot}%{_tmppath}/%{name}.txt 
     44 
     45 
     46%pretrans 
     47echo "Pre-transaction script" 
     48 
     49 
     50%pre 
     51echo "Pre-installation script" 
     52 
     53 
     54%post 
     55echo "Post-installation script" 
     56 
     57 
     58%preun 
     59echo "Pre-uninstallation script" 
     60 
     61 
     62%postun 
     63echo "Post-uninstallation script" 
     64 
     65 
     66%posttrans 
     67echo "Post-transaction script" 
     68 
     69 
     70%verifyscript 
     71echo "Verify script" 
     72 
     73 
     74%clean 
     75[ "%{buildroot}" != / ] && %{__rm} -rf "%{buildroot}" 
     76 
     77 
     78%files 
     79%defattr(-,root,root,-) 
     80%{_tmppath}/%{name}.txt 
     81 
     82 
     83%changelog 
     84* Fri Dec 30 2016 Jiri Tyr <jiri.tyr at gmail.com> 1:2.3-4 
     85- Initial build.