Changeset 1468 in ProjectBuilder for projects/casparbuster
- Timestamp:
- Apr 16, 2012, 2:46:27 AM (13 years ago)
- Location:
- projects/casparbuster
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified projects/casparbuster/devel/Makefile.PL ¶
r1466 r1468 22 22 'bin/cb' => '$(INST_MAN1DIR)/cb.$(MAN1EXT)', 23 23 }, 24 MAN3PODS => { 'lib/CasparBuster/Env.pm' => '$(INST_MAN3DIR)/CasparBuster::Env.$(MAN3EXT)', 25 #'lib/ProjectBuilder/Base.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Base.$(MAN3EXT)', 24 MAN3PODS => { 25 'lib/CasparBuster/Env.pm' => '$(INST_MAN3DIR)/CasparBuster::Env.$(MAN3EXT)', 26 'lib/CasparBuster/Version.pm' => '$(INST_MAN3DIR)/CasparBuster::Version.$(MAN3EXT)', 26 27 }, 27 28 ); -
TabularUnified projects/casparbuster/devel/bin/cbusterize ¶
r1466 r1468 7 7 =head1 SYNOPSIS 8 8 9 cbusterize .pl[options] --source /path/to/file/to/CasparBusterize9 cbusterize [options] --source /path/to/file/to/CasparBusterize 10 10 11 11 Options: … … 100 100 =cut 101 101 use strict; 102 use Cwd 'realpath'; 102 use CasparBuster::Version; 103 use CasparBuster::Env; 104 #use Cwd 'realpath'; 103 105 use File::Find; 104 106 use File::Copy; … … 108 110 use Getopt::Long; 109 111 use Pod::Usage; 112 use Data::Dumper; 110 113 use List::Util qw(first); 111 114 use ProjectBuilder::Base; 112 115 use ProjectBuilder::Conf; 113 use CasparBuster::Env;114 116 115 117 # settings 116 118 my $debug = 0; 117 my $help = 0;118 my $man = 0;119 my $help = undef; 120 my $man = undef; 119 121 my $source = undef; 120 122 my $machine = undef; 123 my $plugin = undef; 121 124 my $quiet = undef; 122 125 my $log = undef; 123 126 my $LOG = undef; 124 127 125 my ($cbver,$cbrev) = pb_version_init();128 my ($cbver,$cbrev) = cb_version_init(); 126 129 my $appname = "cb"; 127 130 $ENV{'PBPROJ'} = $appname; … … 140 143 'log-files|l=s' => \$log, 141 144 'source|s=s' => \$source, 145 'plugin|p=s' => \$plugin, 142 146 ) || pb_syntax(-1,0); 143 147 … … 156 160 $debug = 0 if ($debug == -1); 157 161 } 162 163 $pbdebug = $debug; 158 164 pb_log_init($debug, $LOG); 159 165 pb_log(0,"Starting cbusterize\n"); … … 161 167 # Get conf file in context 162 168 pb_conf_init($appname); 169 # The personal one if there is such 170 pb_conf_add("$ENV{'HOME'}/.cbrc") if (-f "$ENV{'HOME'}/.cbrc"); 163 171 # The system one 164 172 pb_conf_add(cb_env_conffile()); 165 # The personal one if there is such166 pb_conf_add("$ENV{'HOME'}/.cbrc") if (-f "$ENV{'HOME'}/.cbrc");167 173 168 174 # Get configuration parameters 169 my ($basedir,$opt,$usemach,$pluginsdir,$cms) = pb_conf_get("cbbasedir","cbdatabase","cbusemachines","cbpluginssubdir","cbcms"); 175 my %cb; 176 my $cb = \%cb; 177 ($cb->{'basedir'},$cb->{'database'},$cb->{'usemachines'},$cb->{'pluginsdir'},$cb->{'cms'}) = pb_conf_get("cbbasedir","cbdatabase","cbusemachines","cbpluginssubdir","cbcms"); 178 179 print Dumper($cb) if ($debug); 170 180 171 181 # Check for mandatory params 172 pod2usage("Error: --source is a mandatory argument\n") (if not defined $source); 173 pod2usage("Error: --machine is a mandatory argument when configure with cbusemachines = true\n") if ($usemach->{$appname} =~ /true/) && (not defined $machine)); 174 175 # Are the source and basedir full path names ? if not, make it such 176 $source = realpath($source); 177 $basedir = realpath($basedir->{$appname}); 182 pod2usage("Error: --source or --plugin is a mandatory argument\n") if ((not defined $source) && (not defined $plugin)); 183 pod2usage("Error: --machine is a mandatory argument when configure with cbusemachines = true\n") if (($cb->{'usemachines'}->{$appname} =~ /true/) && (not defined $machine)); 184 185 if (defined $plugin) { 186 # Load plugin conf 187 } 188 189 my $basedir = $cb->{'basedir'}->{$appname}; 190 eval { $basedir =~ s/(\$ENV.+\})/$1/eeg }; 178 191 179 192 # debug mode overview … … 218 231 } 219 232 220 # Find the include/install.mk file by looking up the tree 221 # from basedir/machine or basedir if no machine given 222 my $sdir1 = $basedir; 223 $sdir1 .= "/$machine" if defined ($machine); 224 my $sdir = $sdir1; 225 while (! -f "$sdir/include/install.mk") { 226 $sdir = dirname($sdir); 227 if ($sdir eq "/") { 228 die <<EOF; 229 ERROR: No include/install.mk file was found while 230 parsing $sdir1 and its parents 231 Your tree is not CasparBuster compliant. 232 Please fix it before relaunching CasparBuster.pl 233 EOF 234 } 235 } 236 if ($debug) { 237 print "DEBUG: Found sdir = $sdir\n"; 238 } 239 # Now checking conformity 240 print "CHECK: $sdir/include/install.mk\n" if ($debug); 241 my $cf = 0; 242 my $remote = undef; 243 open(MF,"$sdir/include/install.mk"); 244 while (<MF>) { 245 if (($_ =~ /csp_UHOST\s*=/) && ($_ =~ /(\w+\@$machine.*)/)) { 246 $remote = $1; 247 $cf++; 248 if ($debug) { 249 print "DEBUG: csp_UHOST conform line found with ref to $machine\n"; 250 print "DEBUG: remote configuration is $remote\n"; 251 } 252 } 253 if (/include\s+CasparBuster\/mk\/CasparBuster.mk/) { 254 $cf++; 255 if ($debug) { 256 print "DEBUG: include conform line found with ref to CasparBuster.mk\n"; 257 } 258 } 259 } 260 close(MF); 261 if ($cf < 2) { 262 print "WARNING: Non conform $sdir/include/install.mk file found\n"; 263 } 264 die "No remote configuration defined in $sdir/include/install.mk" if (not defined $remote); 265 266 my $target = "$sdir1/$srcdir"; 233 # Deduce the target directory from the local structure and the source 234 my $target = $basedir; 235 $target .= "/$machine" if defined ($machine); 236 $target .= "$srcdir"; 237 267 238 # If both source and target are dirs, then copy into the parent of the target 268 239 $target = basename($target) if ((not defined $srcfile) && (-d $target)); 269 240 270 # Create Makefiles if none exists also in parents, warn else 271 my $tdir = $target; 272 my $sd = $srcdir; 273 while (! -f "$tdir/Makefile") { 274 275 # Create target if it doesn't exist 276 if (not -d $tdir) { 277 if ($debug) { 278 print "DEBUG: Creating recursively directory $tdir\n"; 279 } else { 280 mkpath($tdir,0,0755) or die "Unable to recursively create $tdir"; 281 print "INFO: Created $tdir you may want to add it to your CMS\n"; 282 } 283 } 284 285 if (-f "$tdir/Makefile") { 286 print "CHECK: $tdir/Makefile\n" if ($debug); 287 # Now checking conformity 288 $cf = 0; 289 open(MF,"$tdir/Makefile") || die "Unable to open $tdir/Makefile"; 290 while (<MF>) { 291 my $sd1 = $sd; 292 $sd1 =~ s|/|\/|g; 293 if (/csp_DIR\s*=\s*$sd1/) { 294 $cf++; 295 if ($debug) { 296 print "DEBUG: csp_DIR conform line found with ref to $sd\n"; 297 } 298 } 299 $sd1 = $sdir; 300 $sd1 =~ s|/|\/|g; 301 if (/include\s+$sd1[\/]*install.mk/) { 302 $cf++; 303 if ($debug) { 304 print "DEBUG: include conform line found with ref to install.mk\n"; 305 } 306 } 307 close(MF); 308 309 if ($cf < 2) { 310 print "WARNING: Non conform $tdir/Makefile file found\n"; 311 } 312 } 313 } else { 314 # In this case we create one 315 if ($debug) { 316 print <<EOF; 317 DEBUG: Creating $tdir/Makefile with the following content: 318 csp_DIR = $sd 319 include $sdir/include/install.mk 320 EOF 321 } else { 322 my $mf = "$tdir/Makefile"; 323 $mf =~ s|//|/|g; 324 open(MF,"> $mf") || die "Unable to create $mf"; 325 print MF <<EOF; 326 # Created by CasparBuster.pl - \$Id\$ 327 csp_DIR = $sd 328 # That include should be last of these declarations 329 include $sdir/include/install.mk 330 EOF 331 close(MF); 332 print "INFO: Created $mf you may want to add it to your CMS\n"; 333 } 334 } 335 $tdir = dirname($tdir); 336 $sd = dirname($sd); 241 # Create target if it doesn't exist 242 if (not -d $target) { 337 243 if ($debug) { 338 print "DEBUG: Next round, tdir = $tdir and sd = $sd\n"; 339 } 340 # Stop at basedir 341 last if ($tdir eq $basedir); 244 print "DEBUG: Creating recursively directory $target\n"; 245 } else { 246 mkpath($target,0,0755) or die "Unable to recursively create $target"; 247 print "INFO: Created $target you may want to add it to your CMS\n"; 248 # TODO: Add it to the CMS 249 } 342 250 } 343 251 … … 350 258 351 259 if (defined $machine) { 352 $cmd = "scp -p -q $cmdopt $ remote:$source $target";260 $cmd = "scp -p -q $cmdopt $machine:$source $target"; 353 261 } else { 354 262 $cmd = "cp -p $cmdopt $source $target"; 355 263 } 264 356 265 # Now add content if not already there 357 266 if ((defined $srcfile) && (! -f "$target/$srcfile")) { -
TabularUnified projects/casparbuster/pbconf/devel/casparbuster.pb ¶
r1467 r1468 68 68 # List of files per pkg on which to apply filters 69 69 # Files are mentioned relatively to pbroot/defpkgdir 70 filteredfiles cb = Makefile.PL 70 filteredfiles cb = Makefile.PL,lib/CasparBuster/Version.pm 71 71 #,cb.1,cbusterize.1 72 72 #supfiles cb = cb.init -
TabularUnified projects/casparbuster/pbconf/devel/cb/rpm/cb.spec ¶
r1467 r1468 16 16 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) 17 17 BuildArch: noarch 18 Requires: perl >= 5.8.4,perl-DateManip,perl-ProjectBuilder,perl-File-MimeInfo 18 Requires: perl >= 5.8.4,perl-DateManip,perl-ProjectBuilder,perl-File-MimeInfo,perl-Data-Dumper 19 19 20 20 %description … … 41 41 %doc AUTHORS INSTALL COPYING README 42 42 43 #%{perlvendorlib}/*43 %{perlvendorlib}/* 44 44 %{_bindir}/* 45 45 %{_sysconfdir}/cb 46 46 %{_mandir}/man1/* 47 %{_mandir}/man3/* 47 48 %{_mandir}/man5/* 48 49
Note:
See TracChangeset
for help on using the changeset viewer.