Skip to content

Commit

Permalink
fedora: don't build network-scripts rpm in f40+ (2/2)
Browse files Browse the repository at this point in the history
follow-up to: b751727
  • Loading branch information
jamacku committed Feb 6, 2024
1 parent f7b4a7b commit 3e1a437
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,23 @@ install-translations:
$(MAKE) install -C po DESTDIR=$(DESTDIR) prefix=$(prefix) bindir=$(bindir) libdir=$(libdir) \
datarootdir=$(datarootdir) datadir=$(datadir) sysconfdir=$(sysconfdir)

ifdef NO_NETWORK_SCRIPTS
install-etc: install-etc-init
else
install-etc: install-etc-init install-etc-network
endif

# NOTE: We are removing auxiliary symlink at the beginning.
install-etc:
install-etc-init:
rm -f etc/sysconfig/network-scripts
install -m 0755 -d $(DESTDIR)$(sysconfdir)
cp -a etc/* $(DESTDIR)$(sysconfdir)/
install -m 0755 -d $(DESTDIR)$(sysconfdir)
install -m 0644 etc/rc.d/init.d/functions $(DESTDIR)$(sysconfdir)/rc.d/init.d
install -m 0644 etc/rwtab $(DESTDIR)$(sysconfdir)
install -m 0644 etc/statetab $(DESTDIR)$(sysconfdir)
cp -a etc/sysconfig/* $(DESTDIR)$(sysconfdir)/sysconfig

install-etc-network:
install -m 0755 etc/rc.d/init.d/network $(DESTDIR)$(sysconfdir)/rc.d/init.d

install-usr:
install -m 0755 -d $(DESTDIR)$(prefix)
Expand Down
15 changes: 12 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,29 @@ CC = gcc
CFLAGS += $(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE -fPIE
LDFLAGS += $(RPM_LD_FLAGS) -pie -z relro -z now

PROGS = consoletype genhostid rename_device usernetctl usleep
PROGS = consoletype genhostid rename_device usleep
INSTALL_PROGS = install-progs
ifndef NO_NETWORK_SCRIPTS
PROGS += usernetctl
INSTALL_PROGS += install-network-scripts
else

all: $(PROGS)

install: all
install: $(INSTALL_PROGS)

install-progs:
install -m 0755 -d $(DESTDIR)$(bindir)
install -m 0755 -d $(DESTDIR)$(sbindir)
install -m 0755 -d $(DESTDIR)$(libdir)/udev
install -m 0755 build/usleep $(DESTDIR)$(bindir)
install -m 0755 build/consoletype $(DESTDIR)$(sbindir)
install -m 0755 build/genhostid $(DESTDIR)$(sbindir)
install -m 0755 build/usernetctl $(DESTDIR)$(sbindir)
install -m 0755 build/rename_device $(DESTDIR)$(libdir)/udev

install-network-scripts:
install -m 0755 build/usernetctl $(DESTDIR)$(sbindir)

clean:
rm -f build/*

Expand Down

0 comments on commit 3e1a437

Please sign in to comment.