Changeset f53c7cf in adblock2privoxy


Ignore:
Timestamp:
Feb 20, 2015 2:48:14 PM (5 years ago)
Author:
Alexey Zubritskiy <a.zubritskiy@…>
Branches:
master
Children:
e2b555c
Parents:
fcb4d77
Message:

Deb build

Files:
6 added
10 edited

Legend:

Unmodified
Added
Removed
  • adblock2privoxy-utils/automation/.gitignore

    r18729f8 rf53c7cf  
    11*/ 
     2!run/ 
  • adblock2privoxy-utils/automation/build_all.sh

    r18729f8 rf53c7cf  
    11#!/bin/bash 
     2echo "prepare rpm build:" 
     3echo "remove temp files" 
     4rm -rf ../../adblock2privoxy/.dist-buildwrapper 
    25 
     6echo "start RPM build (see fedora*/build.log files for details)" 
    37parallel ::: \ 
    4 './run_aws_build.sh ami-1eb35469 fedora makeFedoraRpm fedora20_64' \ 
    5 './run_aws_build.sh ami-0bac577c fedora makeFedoraRpm fedora20_i386'  
     8'./run_aws_build.sh ami-1eb35469 fedora "../../adblock2privoxy" "distribution/makeFedoraRpm" fedora20_64' \ 
     9'./run_aws_build.sh ami-0bac577c fedora "../../adblock2privoxy" "distribution/makeFedoraRpm" fedora20_i386'  
     10 
     11echo "prepare deb build:" 
     12echo "copy build script to bin directory" 
     13cp ../../adblock2privoxy/distribution/makeDebFromRpm.sh fedora20_i386/ 
     14cp ../../adblock2privoxy/distribution/makeDebFromRpm.sh fedora20_64/ 
     15 
     16echo "start DEB build (see debian*/build.log files for details)" 
     17parallel ::: \ 
     18'./run_aws_build.sh ami-e7e66a90 admin "fedora20_64" "makeDebFromRpm" debian7_64' \ 
     19'./run_aws_build.sh ami-1be06c6c admin "fedora20_i386" "makeDebFromRpm" debian7_i386'  
  • adblock2privoxy-utils/automation/run_adblock2privoxy.sh

    r18729f8 rf53c7cf  
    11#!/bin/bash 
    2 set -e 
     2echo "get latest binary" 
     3rm run/*.rpm 
     4latestRpm=$(aws s3 ls s3://ab2p|sed -r -e 's/^.*(adblock2privoxy.*fc20\.x86_64\.rpm)/\1/;t;d'|sort|tail -n 1) 
     5aws s3 cp s3://ab2p/$latestRpm run/ 
    36 
    4 AMI=ami-1eb35469 
    5 USER=fedora 
    6 COMMAND=$3 
    7 BUILD_ID=$(date -u "+%Y-%m-%d_%H:%M:%S") 
    8  
    9 echo "build started, see $BUILD_ID/build.log for result" 
    10 mkdir -p $BUILD_ID 
    11 exec > $BUILD_ID/build.log 2>&1 
    12  
    13 echo "create instance of $AMI" 
    14  
    15 INSTANCE_ID=$(aws ec2 run-instances \ 
    16 --image-id "$AMI" \ 
    17 --count 1 \ 
    18 --key-name ab2p \ 
    19 --security-groups launch-wizard-2 \ 
    20 --instance-type c1.medium \ 
    21 --block-device-mappings '[{"DeviceName": "/dev/sda1","Ebs": {"VolumeSize": 10,"DeleteOnTermination": true,"VolumeType": "standard"}}]' \ 
    22 | sed -n -r '/InstanceId/ {s/.*:\s"([[:alnum:]-]+)".*/\1/;p}') 
    23  
    24 echo "$INSTANCE_ID created" 
    25  
    26 echo "Waiting for instance ready" 
    27 INSTANCE_STATUS="" 
    28 until [ "$INSTANCE_STATUS" == "running" ]; do 
    29     echo -n "." 
    30     sleep 1 
    31     INSTANCE_STATUS=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | sed -r 's@.*"Name": "([[:alpha:]]+)".*@\1@;t;d') 
    32 done 
    33 echo "" 
    34  
    35 INSTANCE_IP=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | sed -r 's@.*"PublicIpAddress": "([0-9.]+)".*@\1@;t;d') 
    36 echo "Instance IP address: $INSTANCE_IP" 
    37  
    38 echo "Waiting for ssh ready for user $USER" 
    39 INSTANCE_STATUS="" 
    40 until ssh -q -i ~/.ssh/ab2p.pem -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no" -o "NumberOfPasswordPrompts 0" $USER@$INSTANCE_IP exit; do 
    41     echo -n "." 
    42     sleep 1 
    43 done 
    44  
    45 echo "Upload files" 
    46 sftp -i ~/.ssh/ab2p.pem -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no" $USER@$INSTANCE_IP<<END 
    47 put *.rpm 
    48 exit 
    49 END 
    50  
    51 echo "Install and run adblock2privoxy" 
    52 ssh -t -t -i ~/.ssh/ab2p.pem -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no" $USER@$INSTANCE_IP<<END 
    53 rpm -i *.rpm 
    54 yum install p7zip 
    55  
    56 mkdir -p out/privoxy 
    57 adblock2privoxy -p out/privoxy -w out/web -d www.example.com https://easylist-downloads.adblockplus.org/easylist.txt https://easylist-downloads.adblockplus.org/easyprivacy.txt https://easylist-downloads.adblockplus.org/advblock.txt https://easylist-downloads.adblockplus.org/bitblock.txt https://easylist-downloads.adblockplus.org/cntblock.txt 
    58 7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on all.7z out/ 
    59 rm -rf out 
    60  
    61 mkdir -p out/privoxy 
    62 adblock2privoxy -p out/privoxy -w out/web -d www.example.com https://easylist-downloads.adblockplus.org/easylist.txt 
    63 7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on easylist.7z out/ 
    64 rm -rf out 
    65  
    66 ./$COMMAND.sh | tee build.log 
    67 exit 
    68 END 
    69  
    70 echo "Download result from $RESULT_PATH" 
    71 sftp -i ~/.ssh/ab2p.pem -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no" $USER@$INSTANCE_IP<<END 
    72 get *.7z $BUILD_ID 
    73 exit 
    74 END 
    75  
    76 echo "Upload result to s3" 
    77 aws s3 cp $BUILD_ID\*.7z s3:\\ab2p.zubr.me\ 
    78  
    79 echo "Terminate instance" 
    80 aws ec2 terminate-instances --instance-ids "$INSTANCE_ID" 
     7./run_aws_build.sh ami-1eb35469 fedora "run" "ab2p" ab2p_output 
  • adblock2privoxy-utils/automation/run_aws_build.sh

    r18729f8 rf53c7cf  
    44AMI=$1 
    55USER=$2 
    6 COMMAND=$3 
    7 BUILD_ID=$4 
     6UPLOAD=$3 
     7COMMAND=$4 
     8BUILD_ID=$5 
    89 
    910echo "build started, see $BUILD_ID/build.log for result" 
     
    2425echo "$INSTANCE_ID created" 
    2526 
     27echo "Set trap to terminate instance on exit" 
     28trap "aws ec2 terminate-instances --instance-ids $INSTANCE_ID" EXIT 
     29 
    2630echo "Waiting for instance ready" 
    2731INSTANCE_STATUS="" 
     
    3236done 
    3337echo "" 
     38 
    3439 
    3540INSTANCE_IP=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | sed -r 's@.*"PublicIpAddress": "([0-9.]+)".*@\1@;t;d') 
     
    4449 
    4550echo "Upload files" 
     51dirName=$(basename "$UPLOAD") 
    4652sftp -i ~/.ssh/ab2p.pem -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no" $USER@$INSTANCE_IP<<END 
    47 mkdir adblock2privoxy 
    48 put -r ../../adblock2privoxy 
     53mkdir $dirName 
     54put -r $UPLOAD 
    4955exit 
    5056END 
    5157 
    5258echo "Run build with $COMMAND" 
    53 ssh -t -t -i ~/.ssh/ab2p.pem -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no" $USER@$INSTANCE_IP<<END 
    54 cd adblock2privoxy/distribution 
    55 ./$COMMAND.sh | tee build.log 
    56 exit 
    57 END 
     59ssh -t -t -i ~/.ssh/ab2p.pem -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no" $USER@$INSTANCE_IP "$dirName/$COMMAND.sh | tee build.log" 
    5860 
    59 echo "Download result from $RESULT_PATH" 
     61echo "Download result from /result" 
    6062sftp -i ~/.ssh/ab2p.pem -o "IdentitiesOnly yes" -o "StrictHostKeyChecking no" $USER@$INSTANCE_IP<<END 
    61 get -r adblock2privoxy/distribution/binary/* $BUILD_ID 
     63get -r result/adblock2privoxy* $BUILD_ID 
    6264exit 
    6365END 
     
    6668aws s3 cp $BUILD_ID/adblock2privoxy* s3://ab2p/ 
    6769 
    68  
    69 echo "Terminate instance" 
    70 aws ec2 terminate-instances --instance-ids "$INSTANCE_ID" 
  • adblock2privoxy-utils/src/Main.hs

    r828fba4 rf53c7cf  
    77import ManPage 
    88import RpmSpec 
     9import DebControl 
    910 
    1011-- It is helper executable updating documentation 
     
    1718    cabalMeta <- liftM packageDescription $ readPackageDescription normal "adblock2privoxy.cabal" 
    1819    createManPage verbose cabalMeta      
    19     createRpmSpec verbose cabalMeta                                
     20    createRpmSpec verbose cabalMeta 
     21    createDebControl verbose cabalMeta                                
    2022 
  • adblock2privoxy/INSTALL.rst

    r18729f8 rf53c7cf  
    1212From sources 
    1313------------ 
    14 You can install adblock2privoxy from sources if there is no binary package for your system. 
     14You can install adblock2privoxy from sources if there is no binary package for your system.  
    1515 
    16161. Ensure you have Haskell compiler and Cabal  
     
    2727 
    2828        cabal update 
    29         runhaskell Setup.hs configure --user 
     29        cabal install --user --only-dependencies --enable-optimization=2 
     30        runhaskell Setup.hs configure --user --enable-optimization=2  
    3031        runhaskell Setup.hs build 
    3132        runhaskell Setup.hs install 
  • adblock2privoxy/distribution/makeFedoraRpm.sh

    r18729f8 rf53c7cf  
    11#!/bin/bash 
    22set -e 
    3 echo   This script compiles adblock2privoxy to binary RPM and DEB on Fedora Core. 
     3echo "This script compiles adblock2privoxy to binary RPM on Fedora Core 19-20" 
     4 
     5echo "change dir" 
     6initialDir=$PWD 
     7script="$(readlink -f ${BASH_SOURCE[0]})" 
     8scriptDir="$(dirname $script)" 
     9cd $scriptDir 
     10echo "working dir is $PWD" 
    411 
    512echo "create build folders" 
     
    1017 
    1118echo "install build tools and dependencies" 
     19sudo yum -y install compat-libffi 
    1220sudo yum -y install @development-tools 
    1321sudo yum -y install fedora-packager 
     
    1927rpmbuild --define "_topdir `pwd`/rpmbuild" -bb rpmbuild/SPECS/adblock2privoxy.spec 
    2028 
    21 mkdir -p binary 
    22 mv rpmbuild/RPMS/*/* binary/ 
    23 cd binary 
     29echo "move RPM to result dir" 
     30mkdir -p $initialDir/result 
     31mv rpmbuild/RPMS/*/* $initialDir/result/ 
     32cd $initialDir/result 
    2433 
    25 #echo "convert to DEB" 
    26 #sudo alien * 
    27  
    28 echo Build is done. The result is in current folder 
     34echo "Build is done. The result is in current folder" 
  • adblock2privoxy/distribution/rpmbuild/SPECS/adblock2privoxy.spec

    rfcb4d77 rf53c7cf  
    6868 
    6969%changelog 
    70 * Sat Feb 07 2015 Alexey Zubritskiy <adblock2privoxy@zubr.me> - 1.3.3 
     70* Fri Feb 20 2015 Alexey Zubritskiy <adblock2privoxy@zubr.me> - 1.3.3 
    7171- Rpm release for new version (generated from cabal file) 
  • adblock2privoxy/man/man1/adblock2privoxy.1

    rfcb4d77 rf53c7cf  
    1 .TH "ADBLOCK2PRIVOXY" "1" "2015\-02\-07" "adblock2privoxy 1.3.3" "General Commands Manual" 
     1.TH "ADBLOCK2PRIVOXY" "1" "2015\-02\-20" "adblock2privoxy 1.3.3" "General Commands Manual" 
    22.SH ADBLOCK2PRIVOXY 
    33.PP 
  • adblock2privoxy/src/Main.hs

    rfcb4d77 rf53c7cf  
    5555            text <- loader url 
    5656            now <- getCurrentTime 
    57             case parse adblockFile url text of 
     57            let strictParse = text `seq` parse adblockFile url text 
     58            case strictParse of 
    5859                Right parsed ->  
    5960                        let sourceInfo' = updateInfo now parsed sourceInfo  
Note: See TracChangeset for help on using the changeset viewer.