Changeset 2136 in ProjectBuilder for devel/pb-modules
- Timestamp:
- Aug 28, 2016, 8:03:38 PM (9 years ago)
- Location:
- devel/pb-modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/Makefile.PL
r2032 r2136 22 22 EXE_FILES => [ qw(bin/pbdistrocheck bin/pbgetparam) ], 23 23 MAN1PODS => { 24 25 24 'bin/pbdistrocheck' => '$(INST_MAN1DIR)/pbdistrocheck.$(MAN1EXT)', 25 'bin/pbgetparam' => '$(INST_MAN1DIR)/pbgetparam.$(MAN1EXT)', 26 26 }, 27 27 # MAN3PODS => { 'lib/ProjectBuilder/Distribution.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Distribution.$(MAN3EXT)', … … 37 37 sub postamble { 38 38 39 # Determine location of etcconf files39 # Determine location of conf files 40 40 my $text =""; 41 41 42 # Grab out any CONFDIR or MANDIR param43 my $ etcdir = undef;42 # Grab out any SYSCONFDIR, CONFDIR or MANDIR param 43 my $sharedir = undef; 44 44 my $mandir = undef; 45 my $sysconfdir = undef; 45 46 my $prefix = undef; 46 47 … … 48 49 my ($key, $value) = split /=/, $arg; 49 50 if ($key =~ /^CONFDIR$/) { 50 $etcdir = $value; 51 $sharedir = $value; 52 } elsif ($key =~ /^SYSCONFDIR$/) { 53 $sysconfdir = $value; 51 54 } elsif ($key =~ /^MANDIR$/) { 52 55 $mandir = $value; … … 56 59 } 57 60 58 $ etcdir ||= "$prefix/etc/pb" if (defined $prefix);61 $sharedir ||= "$prefix/share/pb" if (defined $prefix); 59 62 $mandir ||= "$prefix/share/man" if (defined $prefix); 60 $etcdir ||= "/usr/local/etc/pb"; 63 $sysconfdir ||= "$prefix/etc/pb" if (defined $prefix); 64 $sharedir ||= "/usr/local/share/pb"; 61 65 $mandir ||= "/usr/local/share/man"; 66 $sysconfdir ||= "/etc/pb"; 62 67 63 68 # Use that conf dir info to modify Distribution.pm 64 system("perl -pi -e \"s~CCCC~$etcdir~\" lib/ProjectBuilder/Distribution.pm"); 69 system("perl -pi -e \"s~CCCC~$sharedir~\" lib/ProjectBuilder/Distribution.pm"); 70 system("perl -pi -e \"s~SSSS~$sysconfdir~\" lib/ProjectBuilder/Distribution.pm"); 65 71 66 72 $text .= "install ::\n"; 67 $text .= "\t".'mkdir -p $(DESTDIR)'."$etcdir\n"; 68 $text .= "\t".'chmod 755 $(DESTDIR)'."$etcdir\n"; 69 $text .= "\t".'cp etc/pb.conf $(DESTDIR)'."$etcdir\n"; 73 $text .= "\t".'mkdir -p $(DESTDIR)'."$sharedir\n"; 74 $text .= "\t".'chmod 755 $(DESTDIR)'."$sharedir\n"; 75 $text .= "\t".'cp etc/pb.conf $(DESTDIR)'."$sharedir\n"; 76 77 # Also create a fake version in /etc/pb for sysadmin to modify 78 $text .= "\t".'mkdir -p $(DESTDIR)'."$sysconfdir\n"; 79 $text .= "\t".'chmod 755 $(DESTDIR)'."$sysconfdir\n"; 80 $text .= "\t".'perl -p -e \'s|^|#|\' etc/pb.conf > $(DESTDIR)/'."$sysconfdir/pb.conf\n"; 81 # Doesn't seem to work in the makefile generated for now :-( 82 #$text .= "\t".'perl -p -e \'s|^([^#])|#$1|\' etc/pb.conf > $(DESTDIR)/'."$sysconfdir/pb.conf\n"; 70 83 71 84 # Produce the man page for pb.conf -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r2063 r2136 33 33 34 34 our @ISA = qw(Exporter); 35 our @EXPORT = qw(pb_distro_init pb_distro_conffile pb_distro_ get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_get_param pb_distro_get_context pb_distro_to_keylist pb_distro_conf_print pb_apply_conf_proxy);35 our @EXPORT = qw(pb_distro_init pb_distro_conffile pb_distro_sysconffile pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_get_param pb_distro_get_context pb_distro_to_keylist pb_distro_conf_print pb_apply_conf_proxy); 36 36 ($VERSION,$REVISION) = pb_version_init(); 37 37 … … 78 78 79 79 return("CCCC/pb.conf"); 80 } 81 82 =item B<pb_distro_sysconffile> 83 84 This function returns the optional configuration file used for local customization 85 86 =cut 87 88 sub pb_distro_sysconffile { 89 90 return("SSSS/pb.conf"); 80 91 } 81 92 … … 122 133 # depending whether we deal with package install or tar file install 123 134 pb_conf_add(pb_distro_conffile()); 135 136 # Similarly for the local file available for sysadmin. After the previous one to allow overwrite to work 137 pb_conf_add(pb_distro_sysconffile()); 124 138 125 139 # If we don't know which distribution we're on, then guess it
Note:
See TracChangeset
for help on using the changeset viewer.