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 authored and mergify[bot] committed Feb 7, 2024
1 parent d2d8e72 commit e35db93
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ make-translations:
ifdef NO_NETWORK_SCRIPTS
install: install-binaries install-translations install-etc install-usr install-man install-post
else
install: install-binaries install-translations install-etc install-usr install-network-scripts install-man-all install-post
install: install-binaries install-translations install-etc-all install-usr install-network-scripts install-man-all install-post
endif


Expand All @@ -69,12 +69,21 @@ install-translations:
$(MAKE) install -C po DESTDIR=$(DESTDIR) prefix=$(prefix) bindir=$(bindir) libdir=$(libdir) \
datarootdir=$(datarootdir) datadir=$(datadir) sysconfdir=$(sysconfdir)

install-etc-all: install-etc install-etc-network

# NOTE: We are removing auxiliary symlink at the beginning.
install-etc:
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 0755 -d $(DESTDIR)$(sysconfdir)/rc.d/init.d
install -m 0755 -d $(DESTDIR)$(sysconfdir)/sysconfig
install -m 0644 etc/rwtab $(DESTDIR)$(sysconfdir)/
install -m 0644 etc/statetab $(DESTDIR)$(sysconfdir)/
install -m 0644 etc/rc.d/init.d/functions $(DESTDIR)$(sysconfdir)/rc.d/init.d/
install -m 0644 etc/sysconfig/* $(DESTDIR)$(sysconfdir)/sysconfig/

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

install-usr:
install -m 0755 -d $(DESTDIR)$(prefix)
Expand Down
2 changes: 1 addition & 1 deletion initscripts.spec
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ BuildRequires: make
BuildRequires: systemd

Obsoletes: %{name} < 10.16-1
Obsoletes: network-scripts <= 10.20-1
Obsoletes: network-scripts < 10.21-1

# === PATCHES =================================================================

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
endif

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 e35db93

Please sign in to comment.