How to patch UNITS Makefile.in

HOW TO PATCH UNITS Makefile.in

Package: http://ftp.gnu.org/gnu/units/units-2.00.tar.gz

Step 1: Get the units tarball

Step 2: Extract the contents

Step 3: Change into the new directory

Step 4: make 2 new directories, then copy Makefile.in into those directories
mkdir a b
cp Makefile.in ./a
cp Makefile.in ./b

Step 5: Check to show they are the same file
diff -U8 a/Makefile.in b/Makefile.in

Step 6: Modify b/Makefile.in and change these lines:

—————————————————————————–
$(srcdir)/mkinstalldirs @UDAT@  $(DESTDIR)$(bindir)
$(INSTALL_DATA) $(srcdir)/definitions.units @UDAT@definitions.units
$(INSTALL_DATA) $(srcdir)/currency.units @UDAT@currency.units
$(INSTALL_DATA) $(srcdir)/locale.map @UDAT@locale.map
—————————————————————————–
To this: Note: Just adding $(DESTDIR) before @UDAT@
—————————————————————————–
$(srcdir)/mkinstalldirs $(DESTDIR)@UDAT@  $(DESTDIR)$(bindir)
$(INSTALL_DATA) $(srcdir)/definitions.units $(DESTDIR)@UDAT@definitions.units
$(INSTALL_DATA) $(srcdir)/currency.units $(DESTDIR)@UDAT@currency.units
$(INSTALL_DATA) $(srcdir)/locale.map $(DESTDIR)@UDAT@locale.map
——————————————————————————

Step 7: Check that they are different and make the patch file
diff -U8 a/Makefile.in b/Makefile.in
diff -U8 a/Makefile.in b/Makefile.in > makefile.in.patch

Step 8: Copy the makefile.in.patch file into your ~/rpmbuild/SOURCES/ directory
cp makefile.in.patch ~/rpmbuild/SOURCES/

Step 9: Add the patch name to your spec file
—————–After Source files——————–
Patch0:       makefile.in.patch
——————————————————-

Step 10: Add the patch macro, make sure you place it after the setup -q part of the spec file
%patch0 -p1

Run and the patch should be applied and fix the makefile issue

Advertisements

About oatleywillisa

Computer Networking Student
This entry was posted in SBR600. Bookmark the permalink.

2 Responses to How to patch UNITS Makefile.in

  1. Pingback: Building the Units Package with rpmbuild | Andrew Oatley-Willis

  2. Pingback: favicon with png2ico: Where fun happens!!! « maxam

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s