Install into /usr/local/ by default
/usr is package manager territory, and not even writable on OSTree based systems such as Fedora CoreOS or RHEL Edge. This has been common and good practice in autotools for decades. You can still override this with `make install PREFIX=...`. Use that in the RPM spec file.
This commit is contained in:
parent
633e3257ae
commit
57d7c73d6e
3 changed files with 7 additions and 6 deletions
9
Makefile
9
Makefile
|
|
@ -9,6 +9,7 @@ export TEST_OS
|
||||||
TARFILE=$(RPM_NAME)-$(VERSION).tar.xz
|
TARFILE=$(RPM_NAME)-$(VERSION).tar.xz
|
||||||
NODE_CACHE=$(RPM_NAME)-node-$(VERSION).tar.xz
|
NODE_CACHE=$(RPM_NAME)-node-$(VERSION).tar.xz
|
||||||
SPEC=$(RPM_NAME).spec
|
SPEC=$(RPM_NAME).spec
|
||||||
|
PREFIX ?= /usr/local
|
||||||
APPSTREAMFILE=org.cockpit-project.$(PACKAGE_NAME).metainfo.xml
|
APPSTREAMFILE=org.cockpit-project.$(PACKAGE_NAME).metainfo.xml
|
||||||
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
|
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
|
||||||
# stamp file to check for node_modules/
|
# stamp file to check for node_modules/
|
||||||
|
|
@ -91,12 +92,12 @@ clean:
|
||||||
rm -f po/LINGUAS
|
rm -f po/LINGUAS
|
||||||
|
|
||||||
install: $(WEBPACK_TEST) po/LINGUAS
|
install: $(WEBPACK_TEST) po/LINGUAS
|
||||||
mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)
|
mkdir -p $(DESTDIR)$(PREFIX)/share/cockpit/$(PACKAGE_NAME)
|
||||||
cp -r dist/* $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)
|
cp -r dist/* $(DESTDIR)$(PREFIX)/share/cockpit/$(PACKAGE_NAME)
|
||||||
mkdir -p $(DESTDIR)/usr/share/metainfo/
|
mkdir -p $(DESTDIR)$(PREFIX)/share/metainfo/
|
||||||
msgfmt --xml -d po \
|
msgfmt --xml -d po \
|
||||||
--template $(APPSTREAMFILE) \
|
--template $(APPSTREAMFILE) \
|
||||||
-o $(DESTDIR)/usr/share/metainfo/$(APPSTREAMFILE)
|
-o $(DESTDIR)$(PREFIX)/share/metainfo/$(APPSTREAMFILE)
|
||||||
|
|
||||||
# this requires a built source tree and avoids having to install anything system-wide
|
# this requires a built source tree and avoids having to install anything system-wide
|
||||||
devel-install: $(WEBPACK_TEST)
|
devel-install: $(WEBPACK_TEST)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ make
|
||||||
|
|
||||||
# Installing
|
# Installing
|
||||||
|
|
||||||
`make install` compiles and installs the package in `/usr/share/cockpit/`. The
|
`make install` compiles and installs the package in `/usr/local/share/cockpit/`. The
|
||||||
convenience targets `srpm` and `rpm` build the source and binary rpms,
|
convenience targets `srpm` and `rpm` build the source and binary rpms,
|
||||||
respectively. Both of these make use of the `dist` target, which is used
|
respectively. Both of these make use of the `dist` target, which is used
|
||||||
to generate the distribution tarball. In `production` mode, source files are
|
to generate the distribution tarball. In `production` mode, source files are
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ rm -rf dist
|
||||||
ESLINT=0 NODE_ENV=production make
|
ESLINT=0 NODE_ENV=production make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install
|
%make_install PREFIX=/usr
|
||||||
|
|
||||||
# drop source maps, they are large and just for debugging
|
# drop source maps, they are large and just for debugging
|
||||||
find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs --no-run-if-empty rm --verbose
|
find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs --no-run-if-empty rm --verbose
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue