#24 Makefile: Support DESTDIR, PREFIX and fix BINDIR creation
Merged 4 years ago by ankursinha. Opened 4 years ago by akien.
akien/fpaste master  into  master

file modified
+10 -7
@@ -1,6 +1,8 @@ 

  PROG=fpaste

- BINDIR=/usr/bin

- MANDIR=/usr/share/man

+ DESTDIR=

+ PREFIX=/usr

+ BINDIR=$(PREFIX)/bin

+ MANDIR=$(PREFIX)/share/man

  

  #ifeq ($(UID), 0)

  #BINDIR=/usr/bin
@@ -12,10 +14,11 @@ 

  

  

  install:

- 	install -p -m0755 $(PROG) $(BINDIR)

- 	install -d $(MANDIR)/man1

- 	install -p -m 644 docs/man/en/$(PROG).1 $(MANDIR)/man1/

+ 	install -d $(DESTDIR)$(BINDIR)

+ 	install -p -m0755 $(PROG) $(DESTDIR)$(BINDIR)

+ 	install -d $(DESTDIR)$(MANDIR)/man1

+ 	install -p -m 644 docs/man/en/$(PROG).1 $(DESTDIR)$(MANDIR)/man1/

  

  uninstall:

- 	rm -f $(BINDIR)/$(PROG)

- 	rm -f $(MANDIR)/man1/$(PROG).1

+ 	rm -f $(DESTDIR)$(BINDIR)/$(PROG)

+ 	rm -f $(DESTDIR)$(MANDIR)/man1/$(PROG).1

That allows a pretty simple spec file for packaging:

%prep
%setup -q
%autopatch -p1

%build
#nothing required

%install
%make_install

%files
%doc CHANGELOG README.rst
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*

Pull-Request has been merged by ankursinha

4 years ago
Metadata