Skip to content
Browse files

Merge branch '4.0/make-jsmin-target' into 4.0-trunk

Conflicts:
	.gitignore
  • Loading branch information...
2 parents 443aa57 + ed83bb5 commit 71df59643b78fe13be4734f6b26ea2664636bbac @alexmv alexmv committed Aug 18, 2011
Showing with 44 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +41 −0 Makefile.in
View
3 .gitignore
@@ -38,6 +38,9 @@
/config.status
/config.log
/config.pld
+/jsmin.c
+/jsmin
+/bin/jsmin
/nytprof.out*
/.prove
*~
View
41 Makefile.in
@@ -53,6 +53,7 @@
PERL = @PERL@
INSTALL = @INSTALL@
+CC = @CC@
RT_LAYOUT = @rt_layout_name@
@@ -527,3 +528,43 @@ vessel-import: build-snapshot
--skip cpan-capitalization,cpan-mod_perl,cpan-Encode,cpan-PPI,cpan-Test-Exception-LessClever,cpan-Test-Manifest,cpan-Test-Object,cpan-Test-Pod,cpan-Test-Requires,cpan-Test-SubCalls,cpan-Test-cpan-Tester,cpan-Test-Warn --skip-all-recommends
mv $(VESSEL)/scripts/RT/build $(VESSEL)/scripts/RT/build.pl
+JSMIN_URL = http://download.bestpractical.com/mirror/jsmin-2011-01-22.c
+JSMIN_SHA = 8a6b3b980a52c028eb73aee4a82ebe060c1ee854
+
+jsmin: jsmin-checkcc jsmin-fetch jsmin-verify jsmin-confirm jsmin-build jsmin-install
+ @echo ""
+ @echo "To configure RT to use jsmin, add the following line to $(DESTDIR)$(RT_ETC_PATH)/RT_SiteConfig.pm:"
+ @echo ""
+ @echo " Set(\$$JSMinPath, '$(DESTDIR)$(RT_BIN_PATH)/jsmin');"
+ @echo ""
+
+jsmin-checkcc:
+ @[ -n "$(CC)" ] || (echo "You don't appear to have a C compiler, please set CC and re-run configure" && exit 1)
+
+jsmin-confirm:
+ @echo "jsmin is distributed under a slightly unusual license and can't be shipped"
+ @echo "with RT. Before configuring RT to use jsmin, please read jsmin's license"
+ @echo "below:"
+ @echo ""
+ @$(PERL) -pe 'print && exit if /^\*\// or /^#include/' jsmin.c
+ @echo ""
+ @echo "Press Enter to accept the license, or Ctrl-C to stop now."
+ @$(PERL) -e '<STDIN>'
+
+jsmin-fetch:
+ @echo ""
+ @echo "Downloading jsmin.c from $(JSMIN_URL)"
+ @echo ""
+ @$(PERL) -MLWP::Simple -e 'exit not is_success(getstore("$(JSMIN_URL)", "jsmin.c"))' \
+ || (echo "Failed to download $(JSMIN_URL)" && exit 1)
+
+jsmin-verify:
+ @$(PERL) -MDigest::SHA -e \
+ 'exit not Digest::SHA->new(1)->addfile("jsmin.c")->hexdigest eq "$(JSMIN_SHA)"' \
+ || (echo "Verification of jsmin.c failed! Possible man in the middle?" && exit 1)
+
+jsmin-build:
+ $(CC) -o jsmin jsmin.c
+
+jsmin-install:
+ $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "jsmin" "$(DESTDIR)$(RT_BIN_PATH)/"

0 comments on commit 71df596

Please sign in to comment.
Something went wrong with that request. Please try again.