Sync from SUSE:SLFO:Main fillup revision f82641acb4a919a890ea1029dec6c8f9

This commit is contained in:
Adrian Schröter 2024-05-03 12:30:44 +02:00
commit f14dd17c4e
11 changed files with 774 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

20
fillup-1.42-cloexec.patch Normal file
View File

@ -0,0 +1,20 @@
--- SRC/services.c.orig
+++ SRC/services.c
@@ -342,7 +342,7 @@ openFileForReading
{
Service_t returnValue;
- *filePointer = fopen( filename, "r" );
+ *filePointer = fopen( filename, "re" );
if( *filePointer == NULL )
{
fillup_exception( __FILE__, __LINE__, ServiceException,
@@ -368,7 +368,7 @@ openFileForWriting
{
Service_t returnValue;
- *filePointer = fopen( filename, "w" );
+ *filePointer = fopen( filename, "we" );
if( *filePointer == NULL )
{
fillup_exception( __FILE__, __LINE__, ServiceException,

226
fillup-1.42.dif Normal file
View File

@ -0,0 +1,226 @@
--- SRC/consume.c.orig
+++ SRC/consume.c
@@ -140,7 +140,7 @@ consumeUptoBreak
{
break; /* line break detected */
}
- else if( *buffer == EOF )
+ else if( *buffer == 0 )
{
break; /* End-Of-File detected */
}
--- SRC/file.c.orig
+++ SRC/file.c
@@ -35,18 +35,34 @@ readFile
File_t returnValue;
FILE * filePointer;
long fileLength;
- char * buffer = NULL;
if( FileOpened == openFileForReading( filename, &filePointer ) )
{
if( Success == getFileLength( filePointer, &fileLength ) )
{
- if( Success ==
- allocateBuffer( fileLength, ( void ** )&buffer ) )
+ void * ptr;
+
+ /*
+ * Allocate one byte more if a newline must be added
+ */
+ if( Success == allocateBuffer( fileLength + 1 , &ptr ) )
{
- if( Success ==
- readFileToBuffer( filePointer, fileLength, &buffer ) )
- {
+ char * buffer = ( char * )ptr;
+
+ if( Success == readFileToBuffer( filePointer, fileLength, &buffer ) )
+ {
+
+ if ( FALSE == queryParameter( IgnoreEOF ) )
+ {
+ char * eof = (buffer + fileLength - 1);
+
+ if ( *eof != '\n' )
+ {
+ *( eof + 1 ) = '\n';
+ fileLength++;
+ }
+ }
+
addToWatchdog( fileLength );
associateBuffer( fileSpecifier, fileLength, &buffer );
returnValue = FileOperationsSuccessful;
--- SRC/parameters.c.orig
+++ SRC/parameters.c
@@ -368,6 +368,13 @@ queryParameter
}
break;
+ case IgnoreEOF:
+ if( parameterIgnoreEOF == IsSet )
+ {
+ returnValue = TRUE;
+ }
+ break;
+
case IgnoreDefinites:
if( parameterIgnoreDefinites == IsSet )
{
--- SRC/parser.c.orig
+++ SRC/parser.c
@@ -19,7 +19,7 @@
/*--------------------------------- IMPORTS ----------------------------------*/
#include <ctype.h>
-
+#include <unistd.h>
#include "portab.h"
#include "variableblock.h"
#include "parameters.h"
@@ -296,6 +296,7 @@ createAdministrationInfo
unsigned long Size;
char * delimiterString;
char delimiterChar;
+ void * ptr;
queryStringParameter( Delimiter, &delimiterString );
delimiterChar = delimiterString[ 0 ];
@@ -305,23 +306,25 @@ createAdministrationInfo
countDelimiters( delimiterChar, baseFileBuffer, baseFileBufferLength );
baseFileBlocksLength++; /* add possible trailing comment */
Size = baseFileBlocksLength * sizeof( VariableBlock_t );
- if( Success != allocateBuffer( Size, ( void ** )&baseFileBlock ) )
+ if( Success != allocateBuffer( Size, &ptr ) )
{
fillup_exception( __FILE__, __LINE__, ConfigurationException,
"createAdministrationInfo" );
exitOnFailure( );
}
+ baseFileBlock = ( VariableBlock_t * )ptr;
additionalFileBlocksLength = countDelimiters(
delimiterChar, additionalFileBuffer, additionalFileBufferLength );
additionalFileBlocksLength++; /* add possible trailing comment */
Size = additionalFileBlocksLength * sizeof( VariableBlock_t );
- if( Success != allocateBuffer( Size, ( void ** )&additionalFileBlock ) )
+ if( Success != allocateBuffer( Size, &ptr ) )
{
fillup_exception( __FILE__, __LINE__, ConfigurationException,
"createAdministrationInfo" );
exitOnFailure( );
}
+ additionalFileBlock = ( VariableBlock_t * )ptr;
if( queryParameter( ForbiddenFile ) == TRUE )
{
@@ -329,12 +332,13 @@ createAdministrationInfo
delimiterChar, forbiddenFileBuffer, forbiddenFileBufferLength );
forbiddenFileBlocksLength++; /* add possible trailing comment */
Size = forbiddenFileBlocksLength * sizeof( VariableBlock_t );
- if( Success != allocateBuffer( Size, ( void ** )&forbiddenFileBlock ) )
+ if( Success != allocateBuffer( Size, &ptr ) )
{
fillup_exception( __FILE__, __LINE__, ConfigurationException,
"createAdministrationInfo" );
exitOnFailure( );
}
+ forbiddenFileBlock = ( VariableBlock_t * )ptr;
}
}
@@ -477,8 +481,8 @@ getVariable
getVBeginOfBlock( outputBuffer, &Line );
Line = Line + getVLength( outputBuffer );
LinePointer = Line;
- for( lineIndex = 0;
- ( *LinePointer != EOF ) && ( *LinePointer != '\n' );
+ for( lineIndex = 0;
+ ( *LinePointer != 0 ) && ( *LinePointer != '\n' ) ;
lineIndex++ )
{
LinePointer++; /* concerns only the current line */
@@ -1768,6 +1772,8 @@ writeOutput
}
listPointer++;
}
+ if(fflush( filePointer ) != 0) fillup_exception( __FILE__, __LINE__, ServiceException, "cannot flush stream");
+ if(fdatasync ( fileno(filePointer) ) != 0) fillup_exception( __FILE__, __LINE__, ServiceException, "cannot sync stream");
closeFile( filePointer );
}
}
@@ -1830,7 +1836,9 @@ writeOutput
default: break;
}
listPointer++;
- }
+ }
+ if(fflush( filePointer ) != 0) fillup_exception( __FILE__, __LINE__, ServiceException, "cannot flush stream");
+ if(fdatasync ( fileno(filePointer) ) != 0) fillup_exception( __FILE__, __LINE__, ServiceException, "cannot sync stream");
closeFile( filePointer );
}
}
--- SRC/services.c.orig
+++ SRC/services.c
@@ -444,8 +444,9 @@ readFileToBuffer
if( 0 == fseek( filePointer, 0L, SEEK_SET ) )
{
- if( fileLength ==
- ( long )fread( *fileBuffer, sizeof( char ), fileLength, filePointer ) )
+ if( ( fileLength ==
+ ( long )fread( *fileBuffer, sizeof( char ), fileLength, filePointer ) )
+ && ( 0 == ferror( filePointer ) ) )
{
returnValue = Success;
}
@@ -558,23 +559,22 @@ dumpBlock
Service_t
allocateBuffer
(
- long fileLength, /* in */
+ long Length, /* in */
void ** buffer /* out */
)
{
Service_t returnValue;
- *buffer = malloc( fileLength + 1 );
+ *buffer = malloc( Length + 1 );
if( *buffer == NULL )
{
- fillup_exception( __FILE__, __LINE__, ServiceException,
- "malloc" );
+ fillup_exception( __FILE__, __LINE__, ServiceException, "malloc" );
returnValue = Error;
}
else
{
/* reset the buffer */
- ( void )memset( *buffer, EOF, fileLength + 1 );
+ ( void )memset( *buffer, 0, Length + 1 );
returnValue = Success;
}
--- SRC/metadata.c.orig
+++ SRC/metadata.c
@@ -17,7 +17,7 @@
/*--------------------------------- IMPORTS ----------------------------------*/
#include <stdio.h>
-
+#include <unistd.h>
#include "variableblock.h"
#include "services.h"
#include "parser.h"
@@ -392,7 +392,8 @@ setMetadataInfo
logfile );
fprintf( logfile, ">\n\n" );
}
-
+ if(fflush( logfile ) != 0) fillup_exception( __FILE__, __LINE__, ServiceException, "cannot flush stream");
+ if(fdatasync( fileno(logfile) ) != 0) fillup_exception( __FILE__, __LINE__, ServiceException, "cannot sync stream");
closeFile( logfile );
}
}

BIN
fillup-1.42.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

17
fillup-fno-common.patch Normal file
View File

@ -0,0 +1,17 @@
Index: fillup-1.42/SRC/fillup_cfg.h
===================================================================
--- fillup-1.42.orig/SRC/fillup_cfg.h
+++ fillup-1.42/SRC/fillup_cfg.h
@@ -23,9 +23,9 @@
/*-------------------------------- VARIABLES ---------------------------------*/
-const char * cfg_delimiter;
-const char * cfg_commentMarker;
-const char * cfg_quotingMarker;
+extern const char * cfg_delimiter;
+extern const char * cfg_commentMarker;
+extern const char * cfg_quotingMarker;
/*----------------------------------------------------------------------------*/

23
fillup-nodate.patch Normal file
View File

@ -0,0 +1,23 @@
Index: SRC/services.c
===================================================================
--- SRC/services.c.orig
+++ SRC/services.c
@@ -263,11 +263,15 @@ displayVersion
)
{
static const char *versionString =
- "This is fillup, version %1.2f, compiled on %s\n\n";
+ "This is fillup, version %1.2f\n\n";
- if( ( int )( strlen( versionString ) + strlen( __DATE__ ) - 3 ) !=
- fprintf( stderr, versionString, VERSION, __DATE__ ) )
+ if( ( int )( strlen( versionString ) - 1 ) !=
+ fprintf( stderr, versionString, VERSION ) )
{
+int res= fprintf( stderr, versionString, VERSION );
+
+fprintf (stderr,"strlen: %d, res: %d\n", strlen( versionString ), res);
+
fillup_exception( __FILE__, __LINE__, ServiceException,
"displayVersion" );
exitOnFailure( );

41
fillup-optflags.patch Normal file
View File

@ -0,0 +1,41 @@
--- SRC/Makefile.orig
+++ SRC/Makefile
@@ -37,7 +37,7 @@ ARCHIVE = ${PROJDIR}/ARCHIVE
WARNINGS = -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
# WARNINGS = -Wunused -Wswitch -Wformat -Wreturn-type -Wimplicit -Wmissing-prototypes -Wmissing-declarations
-DEFINES =
+DEFINES = -D_GNU_SOURCE
# LINUX system
OPTISPLUS =
@@ -46,24 +46,23 @@ INC = -I/usr/include
COMPILER = -DGCC=1
# Set OPTIS to the following values
-OPTIS = $(OPTISPLUS) -O2 -fforce-addr -finline-functions -fno-function-cse \
- -fkeep-inline-functions
+OPTIS = $(OPTISPLUS) -O2
ifeq ($(COMPILE_OPTION),DEBUG)
# compile for debugging
- COMPILE = gcc -fsigned-char -DDEBUG -ansi -g -c ${WARNINGS} -I${SRC} -I${INC} ${COMPILER} ${SYS} ${DEFINES}
+ COMPILE = gcc -DDEBUG -std=gnu99 -g -c $(OPTIS) ${WARNINGS} -I${SRC} -I${INC} ${COMPILER} ${SYS} ${DEFINES}
LINK = gcc -g
endif
ifeq ($(COMPILE_OPTION),OPTIMIZE)
# compile with all optimizations
- COMPILE = gcc -fsigned-char -ansi -c $(OPTIS) $(WARNINGS) -I${SRC} -I${INC} ${COMPILER} ${SYS} ${DEFINES}
- LINK = gcc -O -s
+ COMPILE = gcc -std=gnu99 -c $(OPTIS) $(WARNINGS) -I${SRC} -I${INC} ${COMPILER} ${SYS} ${DEFINES}
+ LINK = gcc
endif
ifeq ($(COMPILE_OPTION),PROFILE)
# compile for use with "gprof"
- COMPILE = gcc -fsigned-char -ansi -pg -c ${WARNINGS} -I${SRC} -I${INC} ${COMPILER} ${SYS} ${DEFINES}
+ COMPILE = gcc -ansi -pg -c ${WARNINGS} -I${SRC} -I${INC} ${COMPILER} ${SYS} ${DEFINES}
LINK = gcc -pg
endif

11
fillup-retval.dif Normal file
View File

@ -0,0 +1,11 @@
--- TEST/FCSR/SRC/CreateRemoved.c
+++ TEST/FCSR/SRC/CreateRemoved.c
@@ -48,7 +48,7 @@
printf( "\n" );
index = 0;
- if( argument & 0x2L ) return; /* single variable but removed */
+ if( argument & 0x2L ) return 0; /* single variable but removed */
argument = argument >> 2;
while( ( index < numberOfKeywords ) && ( argument > 0 ) )

97
fillup-warnings.dif Normal file
View File

@ -0,0 +1,97 @@
diff -ruN fillup-1.42/SRC/metadata.c fillup-1.42-new/SRC/metadata.c
--- fillup-1.42/SRC/metadata.c 2003-09-10 14:20:00.000000000 +0200
+++ fillup-1.42-new/SRC/metadata.c 2005-07-06 10:50:55.000000000 +0200
@@ -165,6 +165,10 @@
MetadataKeyword_t loop;
long offset;
+ /* Both return values are explicitely initialized */
+ Result = Metadata_Number;
+ *length = 0;
+
offset = 0;
offset += consumeBlanksOrTabs( &precedingComment[ offset ], variableLength - offset );
for( loop=0; loop<Metadata_Number; loop++ )
diff -ruN fillup-1.42/SRC/parser.c fillup-1.42-new/SRC/parser.c
--- fillup-1.42/SRC/parser.c 2003-09-10 23:00:26.000000000 +0200
+++ fillup-1.42-new/SRC/parser.c 2005-07-06 11:01:35.000000000 +0200
@@ -106,6 +106,7 @@
long remainingInputChars /* in */
);
+#if DEBUG
static
void
printBlockInfo
@@ -121,13 +122,13 @@
VariableBlock_t * list /* in */
);
-
static
void
displayVerboseValue
(
long verboseValue /* in */
);
+#endif
static
void
@@ -597,6 +598,7 @@
}
}
+#if DEBUG
/*---------------- printBlockInfo ------------------*/
static
@@ -668,6 +670,7 @@
list = getVSucc( list );
}
}
+#endif
/*------------ displayVerboseString ---------------*/
void
@@ -682,6 +685,7 @@
}
}
+#if DEBUG
/*------------ displayVerboseValue ----------------*/
static
@@ -696,6 +700,7 @@
displayValue( verboseValue );
}
}
+#endif
/*------------ displayVerboseBuffer ---------------*/
@@ -907,6 +912,12 @@
break;
default:
+ /* next four statements are inserted to eliminate gcc warnings */
+ inputBuffer = (char *)NULL;
+ inputLength = 0;
+ outputBuffer = (VariableBlock_t *)NULL;
+ outputLength = 0;
+
fillup_exception( __FILE__, __LINE__, DefaultBranchException,
"parseFile" );
break;
diff -ruN fillup-1.42/SRC/services.c fillup-1.42-new/SRC/services.c
--- fillup-1.42/SRC/services.c 2003-09-10 14:20:01.000000000 +0200
+++ fillup-1.42-new/SRC/services.c 2005-07-06 14:03:37.000000000 +0200
@@ -251,7 +251,7 @@
char character /* in */
)
{
- ( void )fputc( character, stderr );
+ ( void )fputc( ( int )character, stderr );
}
/*---------------- displayVersion ------------------*/

225
fillup.changes Normal file
View File

@ -0,0 +1,225 @@
-------------------------------------------------------------------
Tue Dec 27 10:36:20 UTC 2022 - Ludwig Nussel <lnussel@suse.com>
- Replace transitional %usrmerged macro with regular version check (boo#1206798)
-------------------------------------------------------------------
Wed Aug 24 10:45:42 UTC 2022 - Andreas Schwab <schwab@suse.de>
- Makefile is not parallel-safe
-------------------------------------------------------------------
Wed Apr 27 10:14:27 UTC 2022 - Dirk Müller <dmueller@suse.com>
- use https as url
-------------------------------------------------------------------
Fri Oct 16 09:47:35 UTC 2020 - Ludwig Nussel <lnussel@suse.de>
- prepare usrmerge (boo#1029961)
-------------------------------------------------------------------
Wed Jan 15 09:38:33 UTC 2020 - Adam Majer <adam.majer@suse.de>
- fillup-fno-common.patch: fix compilation on Tumbleweed
(boo#1160871)
-------------------------------------------------------------------
Thu Nov 23 13:39:57 UTC 2017 - rbrown@suse.com
- Replace references to /var/adm/fillup-templates with new
%_fillupdir macro (boo#1069468)
-------------------------------------------------------------------
Mon Nov 3 13:09:25 UTC 2014 - tchvatal@suse.com
- Also return back the /bin/fillup provides line
-------------------------------------------------------------------
Fri Oct 31 12:02:57 UTC 2014 - dimstar@opensuse.org
- Keep /bin/fillup as a symlink in the package: there are hundreds
of RPMs out there referencing it in the %post scriptlets, when
any of the %*fillup* macros was used. Even updating the macro
will not make the existing RPMs magically be fixed.
-------------------------------------------------------------------
Sun Oct 26 09:10:04 UTC 2014 - tchvatal@suse.com
- Cleanup the mess in spec with spec-cleaner
-------------------------------------------------------------------
Wed Feb 8 13:08:55 UTC 2012 - rschweikert@suse.com
- place binary into /usr tree (UsrMerge project)
-------------------------------------------------------------------
Fri Sep 30 15:00:41 UTC 2011 - uli@suse.com
- cross-build workarounds: disable %build section testing, use fake
gcc script to work around build system deficiencies
-------------------------------------------------------------------
Sun Sep 18 17:17:12 UTC 2011 - jengelh@medozas.de
- Apply packaging guidelines (remove redundant/obsolete
tags/sections from specfile, etc.)
-------------------------------------------------------------------
Sat May 21 20:34:06 UTC 2011 - crrodriguez@opensuse.org
- Open all file descriptors with O_CLOEXEC
- handle out-of-disk-space situations somewhat better.
-------------------------------------------------------------------
Mon Jun 28 06:38:35 UTC 2010 - jengelh@medozas.de
- use %_smp_mflags
-------------------------------------------------------------------
Sun Dec 13 13:17:06 UTC 2009 - aj@suse.de
- Do not compile in date into binary to create reproduceable binaries.
-------------------------------------------------------------------
Sun Dec 13 01:25:18 CET 2009 - jengelh@medozas.de
- enable parallel building
-------------------------------------------------------------------
Wed Aug 26 12:53:54 CEST 2009 - mls@suse.de
- make patch0 usage consistent
-------------------------------------------------------------------
Tue Sep 19 14:40:35 CEST 2006 - rguenther@suse.de
- Do not install info or plaintext documentation (same as manpage).
- Remove sgmltool BuildRequires.
-------------------------------------------------------------------
Mon May 22 20:27:04 CEST 2006 - schwab@suse.de
- Don't strip binaries.
-------------------------------------------------------------------
Wed Jan 25 21:30:12 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Wed Jan 11 19:14:17 CET 2006 - ro@suse.de
- fix missing return value in test-code (#139594)
-------------------------------------------------------------------
Fri Sep 2 13:20:59 CEST 2005 - werner@suse.de
- Fix segv on big endian (bug #114066)
* Correct usage of EOF macro, this is and was never a character
* Make it handle missing newline at EOF
- Make it strict alias safe
- Compare the correct debug output in test suite (bug #95371)
-------------------------------------------------------------------
Wed Jul 27 15:52:42 CEST 2005 - ro@suse.de
- silence some compiler warnings (#95370)
-------------------------------------------------------------------
Tue Jun 28 01:27:23 CEST 2005 - ro@suse.de
- removed -fsigned-char (#93875)
-------------------------------------------------------------------
Wed Jun 15 16:34:04 CEST 2005 - meissner@suse.de
- Use RPM_OPT_FLAGS -fno-strict-aliasing.
- compile OPTIMIZE, drop some no longer applying -f flags.
-------------------------------------------------------------------
Mon Mar 1 14:49:13 CET 2004 - ro@suse.de
- fix install_info stuff in postun
-------------------------------------------------------------------
Mon Oct 20 01:43:48 CEST 2003 - ro@suse.de
- use defattr
- don't build as root
-------------------------------------------------------------------
Thu Sep 11 18:11:16 CEST 2003 - ro@suse.de
- update to 1.42 (#30279)
-------------------------------------------------------------------
Mon Aug 25 16:18:41 CEST 2003 - ro@suse.de
- update to 1.41
- additional Keyword: PreSaveCommand
-------------------------------------------------------------------
Thu Aug 14 14:48:23 CEST 2003 - ro@suse.de
- update to 1.38 with additional MetaData keywords
-------------------------------------------------------------------
Mon Jun 16 14:31:46 CEST 2003 - kukuk@suse.de
- Remove /var/adm/fillup-templates, already in filesystem package
-------------------------------------------------------------------
Wed Mar 12 21:33:38 CET 2003 - ro@suse.de
- update to 1.24 including the last two patches and
more testcases for "make check"
-------------------------------------------------------------------
Wed Mar 12 14:14:51 CET 2003 - ro@suse.de
- switch behaviour to "fixed sequence of metadata" (#25119)
-------------------------------------------------------------------
Sun Mar 9 20:57:43 CET 2003 - ro@suse.de
- fix watchdog for removal part (factor 2 needed)
(fix for reopened #24648)
-------------------------------------------------------------------
Thu Mar 6 17:29:16 CET 2003 - ro@suse.de
- update to 1.22 (avoid possible infinite loop on failure) (#24648)
-------------------------------------------------------------------
Thu Mar 6 14:43:33 CET 2003 - ro@suse.de
- fix for stale comment when removing variable (#24540)
-------------------------------------------------------------------
Wed Feb 19 10:59:08 CET 2003 - ro@suse.de
- update to 1.21
- works around problem with comments wrongly typed as metadata
-------------------------------------------------------------------
Thu Feb 6 17:13:16 CET 2003 - ro@suse.de
- added install-info macros
-------------------------------------------------------------------
Thu Nov 28 14:36:50 CET 2002 - ro@suse.de
- update to 1.20 beta (aka prototype)
-------------------------------------------------------------------
Mon Nov 11 11:26:13 CET 2002 - ro@suse.de
- changed neededforbuild <sp> to <opensp>
-------------------------------------------------------------------
Mon Aug 12 13:53:04 CEST 2002 - ro@suse.de
- split off aaa_base

88
fillup.spec Normal file
View File

@ -0,0 +1,88 @@
#
# spec file for package fillup
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
Name: fillup
Version: 1.42
Release: 0
Summary: Tool for Merging Config Files
License: GPL-2.0-or-later
Group: System/Base
URL: https://github.com/openSUSE/fillup
Source: fillup-%{version}.tar.bz2
Patch0: fillup-optflags.patch
Patch1: fillup-warnings.dif
Patch2: fillup-%{version}.dif
Patch3: fillup-retval.dif
Patch4: fillup-nodate.patch
Patch5: fillup-1.42-cloexec.patch
Patch6: fillup-fno-common.patch
Provides: aaa_base:/bin/fillup
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
fillup merges files that hold variables. A variable is defined by an
entity composed of a preceding comment, a variable name, an assignment
delimiter, and a related variable value. A variable is determined by
its variable name.
%prep
%setup -q
%patch0
%patch1 -p1
%patch2
%patch3
%patch4
%patch5
%patch6 -p1
%build
make %{?_smp_mflags} compile COMPILE_OPTION=OPTIMIZE OPTISPLUS="%{optflags}"
%install
mkdir -p %{buildroot}%{_fillupdir}
install -d -m 755 %{buildroot}/%{_bindir}
install -m 755 BIN/fillup %{buildroot}/%{_bindir}
install -d %{buildroot}/%{_mandir}/man8
install -m 644 SGML/fillup.8.gz %{buildroot}/%{_mandir}/man8
%if 0%{?suse_version} < 1550
# There are literally hundreds of rpm scritps referencing /bin/fillup (suse macro)
# So let's at least keep the symlink there for now (DimStar - 2014-10-31)
install -d -m 755 $RPM_BUILD_ROOT/bin
ln -sf %{_bindir}/fillup $RPM_BUILD_ROOT/bin
%endif
%check
# Makefile is not parallel-safe
make test OPTISPLUS="%{optflags}"
%files
%defattr(-,root,root)
# rpm scriptlets still use this, based on %*fillup* macros
%if 0%{?suse_version} < 1550
/bin/fillup
%endif
%{_bindir}/fillup
%{_mandir}/man8/fillup*
%changelog