# co/tl/dat/Makefile - Makefile for Teller County, CO data # Generated by Makefile.pl - Generic Makefile.pl BASE_FILES = races.txt distname.tsv SOURCE_FILES = INT_FILES = btcont.dat distcont.tsv \ pctdist.tsv.gz btdata.tsv csetdata.tsv distset.tsv.gz electiondists.tsv \ btconterr.tsv dsconterr.tsv zip.unsort UPLOAD_FILES = distname.tsv pctdist.tsv.gz races.txt RELEASE_DIR = ../../../../../../../sv/2013/12/26/co/tl/dat TEST_DIR = ../../../../../../../svtest/2013/12/26/co/tl/dat CDAT = ../../../../../../co/tl/dat CHOME = ../../../../../../co/tl BALDB_SRC = pollplace.db pollplace.dat btcont.dat default: zip: zip -u co-tl-src.zip $(SOURCE_FILES) addrdb.zip: zip -u addrdb.zip lookup.db zip.sort.gz rm lookup.db zip.sort.gz zip.merge.gz archive: $(BASE_FILES) zip -u co-tl-arc.zip $(BASE_FILES) unzip: unzip -u co-tl-src.zip cleansource: zip rm -f $(SOURCE_FILES) $(INT_FILES) checkout: co -l $(BASE_FILES) checkin: ci $(BASE_FILES) idx co-tl-raceidx.tsv co-tl-candidx.tsv: races.txt mkraceidx.pl candcsv co-tl-cands.csv: races.txt mkcandcsv.pl cands.zip co-tl-races.zip co-tl-races2.zip co-tl-cands.zip co-tl-cands2.zip \ co-tl-raceidx.txt co-tl-candidx.txt: races.txt mkracetsv.pl mvdist: distname.new.tsv mv distname.new.tsv distname.tsv distdiff: distname.new.tsv diff distname.tsv distname.new.tsv newpoll: cleanbt pollplace.db precinct.db pollplace-ext.tsv pollplace-ext.tsv: pollplace.db pollplace.dat mkpollext.pl racediff: races-ez.new.txt diff races-ez.txt races-ez.new.txt newdat: newdat0: newmakefile: Makefile.pl #----------------------------------------------------------------- # Standard Intermediate Files: # zip.unsort - Unsorted street ranges # btcont.dat - List of contest codes per ballot type # contcode.dat - List of contest names per contest number # distcities.dat - List of City codes for each district code # races.txt - List of elected offices # cityzip.name - List of City names and zip for each city code # pollplace.db - Polling place locations in HTML # pollplace.dat - (vote-precinct,seek,len) triple into pollplace.db #----------------------------------------------------------------- # Summary of files created by programs: (common across counties) # zip.sort - zip/street/address lines in ASCII sort order # zip.merge - Addr #-> precinct changes per zip/street-name # cityzip.sort - List of city codes with zip codes found # pctcity.dat - Precinct codes found with list of city codes # contdist.dat - A table of (contest_code,district_code) mappings # distcities2.dat - List of City names for each district code # lookup.db - Binary database used by uvote4 # pctidx.map - Table of (precinct,index) allocations # precinct.db - Binary precinct info database for uvote4 # ballot.html - Full ballot in HTML # contest.map - Map of seek addresses in ballot.html for each contest # races.db - Btree database of races.txt # co-tl-races.zip - CSV Database of offices (selected fields) # co-tl-races2.zip - CSV Database of offices (all fields) # co-tl-cands.zip - CSV Database of candidates (selected fields) # co-tl-cands2.zip - CSV Database of candidates (all fields) # co-tl-raceidx.txt - Text index of offices # co-tl-candidx.txt - Text index of candidates # co-tl-cands.csv - CSV Database of candidates (selected fields) #----------------------------------------------------------------- #----------------------------------------------------------------- stateraces.txt: ../../state/dat/races.txt \ ${SMARTVOTER_PL}/mkstateraces.pl mkstateraces.pl #----------------------------------------------------------------- ciraces: races-ez.new.txt races.new.txt - mv races-ez.new.txt races-ez.txt - mv races-ez.ct.new.txt races-ez.ct.txt - mv races.new.txt races.txt - ci -l '-t-Simplified Race Definition' '-mnewraces' races-ez.txt - ci -l '-t-Race Definition' '-mnewraces' races.txt #----------------------------------------------------------------- # MKDISTCONT.PL # This script scans the races.txt and measures.txt file for district codes # distcont.tsv - Table of District_Code District_Name and Contest_Codes distcont.tsv : distname.tsv \ races.txt ${SMARTVOTER_PL}/mkdistcont.pl mkdistcont.pl #----------------------------------------------------------------- # MKCSETDATA.PL # This script handles precinct/contest/district/pollplaceid mapping # and also generates summary files. # btconterr.tsv - Ballot types with contest-id mismatch # dsconterr.tsv - District groups with Ballot type/contest-id mismatch # btdata.tsv - Extracted info on ballot types # csetdata.tsv - Derived contest sets # distset.tsv.gz- Derived district group sets # electiondists.tsv - Districts used in this election # btcont.dat - Ballot types+contests from csetdata.tsv btcont.dat btdata.tsv csetdata.tsv distset.tsv.gz electiondists.tsv: \ distname.tsv distcont.tsv pctdist.tsv.gz \ ${SMARTVOTER_PL}/mkcsetdata.pl mkcsetdata.pl #----------------------------------------------------------------- # The buildballotdb.pl routine references btdb.pl and reads: precinct.db: btcont.dat csetdata.tsv #----------------------------------------------------------------- #----------------------------------------------------------------- # MKRACESDB.PL # Creates a races.db file containing the contents of the races.txt # Updates the $ENV{SMARTVOTER_YRHOME}/dat/candidate.db index of # all candidates. races.db: races.txt ${SMARTVOTER_PL}/mkracesdb.pl mkracesdb.pl #----------------------------------------------------------------- races.ct.txt races.cth.txt: races.txt mkracect.pl #----------------------------------------------------------------- # mkcontestgroups.pl # Creates a contestgroups.ext.txt file from the the races.txt file # for hand editing the contestgroups.txt file contestgroups contestgroups.ext.txt: races.txt mkcontestgroups.pl #----------------------------------------------------------------- # GENELECTHTML.PL # Reads templates and generates HTML ../linkmenu.html: races.txt genelecthtml.pl linkmenu #ballot ../ballot.html: races.txt contestgroups.txt measures.txt ballot ../ballot.html: races.txt ../linkmenu.html races.db \ ${SMARTVOTER_HOME}/templates/ballot.html genelecthtml.pl ballot.html co/tl/ballot.html json ../ballot.json: races.txt ../linkmenu.html races.db \ ${SMARTVOTER_HOME}/templates/ballot.html genelecthtml.pl ballot.json co/tl/ballot.json testballot ../ballot2.html: races.txt ../linkmenu.html races.db \ ${SMARTVOTER_HOME}/templates/ballot.html genelecthtml.pl -T ballot.html co/tl/ballot2.html ../polllist.html polllist: pollplace.db pollplace.dat genelecthtml.pl polllist results-preview ../results-preview.html: races.txt ../linkmenu.html races.db \ ${SMARTVOTER_HOME}/templates/ballot.html genelecthtml.pl -T ballot.html co/tl/results-preview.html baldir: races.txt races.ct.txt \ ${SMARTVOTER_HOME}/templates/baldir.html genelecthtml.pl baldir co/tl races: races.txt ../linkmenu.html ../vote/status.html races.db genelecthtml.pl race.html co/tl/race/xxx/index.html measures: measures.toc.txt genelecthtml.pl measure.html co/tl/meas/xxx/index.html genelecthtml.pl measurelist.html co/tl/meas/index.html candpages: genelecthtml.pl cand co/tl/vote/xxx newcandpages: genelecthtml.pl -u cand co/tl/vote/xxx candraceupd: genelecthtml.pl candraceupd co/tl/vote/xxx candpreviews: genelecthtml.pl preview co/tl/vote/xxx candpages2: genelecthtml.pl cand2 co/tl/vote/xxx info infopages: genelecthtml.pl info co/tl status ../vote/status.html: races.txt genelecthtml.pl status co/tl demoballot: mkdemoballot.pl home: genelecthtml.pl home co/tl ../index.html: ${CDAT}/co-tl-profile.txt ${CHOME}/linkdefs.home.txt genelecthtml.pl home co/tl home2: genelecthtml.pl home2 co/tl ../index2.html: ${CDAT}/co-tl-profile.txt ${CHOME}/linkdefs.home.txt genelecthtml.pl home2 co/tl new: races.ct.txt races.db status infopages regen: races baldir ballot home updateall: new races baldir ballot home co-tl-raceidx.tsv co-tl-candidx.tsv updatesync: updateall sync sync: syncdata.pl ciupdate: ciraces new races baldir ballot home ci: - ci -l '-t-Simplified Race Definition' '-mnewraces' races-ez.txt - ci -l '-t-Race Definition' '-mnewraces' races.txt #----------------------------------------------------------------- # ZIP.SORT # Within the county directory, the street.pl program processes the # Master Street Index, containing street address range to precinct mapping. # This data is reformatted into a zip/street/address line for sorting. # # zip.unsort - Unsorted street ranges # cityzip.sort - List of city codes with zip codes found # pctcity.dat - Precinct codes found with list of city codes # The zipcode/street/addr file is sorted prior to processing using # regular Unix sort # # zip.sort - zip/street/address lines in ASCII sort order zipsort: zip.unsort sort zip.unsort |gzip -c >zip.sort.gz #----------------------------------------------------------------- # MERGE.PL # The merge.pl program reads the sorted zip/street/addr database, # condenses the address ranges to a precinct transition format per # zip/street. # # zip.merge - Addr #-> precinct changes per zip/street-name zip.merge.gz: zip.sort.gz ${SMARTVOTER_PL}/merge.pl gunzip -c zip.sort.gz | merge.pl |gzip -c >zip.merge.gz streeterrs overlap.log: zipmerge.log zip.merge.gz streeterrs.pl #----------------------------------------------------------------- # CONTCITIES2.PL # The contcities2.pl program read the city codes per district, # the names of the cities per code, and produces the list of # city names per district. # # Manually created files: # cityzip.name - List of City names and zip for each city code # (Must be created by hand by editing cityzip.sort. See # http://www.usps.gov/ncsc/lookups/lookup_ctystzip.html) # # distcities2.dat - List of City names for each district code distcities2.dat: distcities.dat cityzip.name contcities2.pl #----------------------------------------------------------------- # MKPCTIDX.PL # The mkpctidx.pl program reads the zip.sort file and collects the # Set of precinct numbers and assigns compacted index numbers 1..n # # pctidx.map - Table of (precinct,index) allocations pctidxmap: zip.sort.gz ${SMARTVOTER_PL}/mkpctidx.pl gunzip -c zip.sort.gz | mkpctidx.pl pctidx2.map: zip.sort.gz ${SMARTVOTER_PL}/mkpctidx.pl gunzip -c zip.sort.gz | mkpctidx.pl -2 pctdiff: pctidx2.map diff pctidx.map pctidx2.map |head #----------------------------------------------------------------- # BUILDADDRDB.PL # The buildaddrdb.pl program reads the merged street address file # and generates the database used by uvote4. A side index file contains # the index numbers used for precincts. # # lookup.db - Binary database used by uvote4 lookup.db: pctidx.map zip.merge.gz \ ${SMARTVOTER_PL}/buildaddrdb.pl gunzip -c zip.merge.gz |buildaddrdb.pl #----------------------------------------------------------------- # BUILDBALLOTDB.PL # The buildballotdb.pl # # precinct.db - Binary precinct info database for uvote4 precinct.db: ../ballot.html pctidx.map \ btcont.dat \ ${SMARTVOTER_PL}/buildballotdb.pl buildballotdb.pl precinct.json.db: ../ballot.json pctidx.map \ btcont.dat \ ${SMARTVOTER_PL}/buildballotdb.pl buildballotdb.pl -s json #----------------------------------------------------------------- # CLEANBT # Use "make cleanbt" to erase the prior set of intermediate data files # used in constructing ballots. This will correct problems with timestamps # on the files. cleanbt: rm -f btcont.dat btcont2.dat distcont.tsv csetdata.tsv precinct.tsv pollplace.db pollplace.dat #----------------------------------------------------------------- # Upload/Sync to remote machines # Test upload to www.smartvoter.org testup: up -t $(UPLOAD_FILES) # Test Sync files from test area to release area testrelease: rsync -tpnv $(UPLOAD_FILES) $(RELEASE_DIR)/ # Sync non-linked files from test area to release area release: rsync -tpv $(UPLOAD_FILES) $(RELEASE_DIR)/ # Sync newer files in test area to release area releasenew: rsync -tpvu $(UPLOAD_FILES) $(RELEASE_DIR)/ # Test Sync newer files in test area to release area testreleasenew: rsync -tpvun $(UPLOAD_FILES) $(RELEASE_DIR)/ # Test Sync newer files in release area to test area testupdtest: rsync -tpvun $(UPLOAD_FILES) $(TEST_DIR)/ # Sync newer files in release area to test area updtest: rsync -tpvu $(UPLOAD_FILES) $(TEST_DIR)/ # Sync newer profile and link files in release area to test area updtestprofile: rsync -vRlupbt co-tl-profile.txt ../linkdefs.home.txt \ $(TEST_DIR)/ # Sync newer profile and link files in test are to release area releaseprofile: rsync -vRlupbt co-tl-profile.txt ../linkdefs.home.txt \ $(RELEASE_DIR)/ # Sync files (upload) to www.smartvoter.org up: up $(UPLOAD_FILES) # Sync files (upload) to www.smartvoter.org uploadsvtest: up -T $(UPLOAD_FILES) # Sync files (upload) to www.smartvoter.org uploadall: up $(UPLOAD_FILES) zip.sort.gz # Sync files (upload) to www.smartvoter.org uploadlookup: rsync -vptz lookup.db smartvot:$(UPLOAD_DIR) # Sync files (upload) to www.smartvoter.org downloadcg: rsync -vbuptz smartvot:$(UPLOAD_DIR)contestgroups.txt . upbaldbsrc: rsync -vRluptz $(BALDB_SRC) smartvot:$(UPLOAD_DIR) uploadprofile: rsync -vRlupbtz co-tl-profile.txt ../linkdefs.home.txt \ smartvot:$(UPLOAD_DIR) downloadprofile: down '*profile*.txt' copynewelection: rsync -vlupt $(UPLOAD_FILES) co-tl-arc.zip $(HOME)/$(UPLOAD_DIR) rsync -tp raceswon.txt $(HOME)/$(UPLOAD_DIR)races.txt rm $(HOME)/$(UPLOAD_DIR)measures.toc.txt touch $(HOME)/$(UPLOAD_DIR)/measures.toc.txt touch $(HOME)/$(UPLOAD_DIR)zip.sort.gz cp pctidx.map $(HOME)/$(UPLOAD_DIR) # Hard link street intermediate files into release area releaseln: ln zip.sort.gz $(RELEASE_DIR)/ uploadint: rsync -vptz btcont.dat distcont.tsv \ pctdist.tsv.gz btdata.tsv csetdata.tsv distset.tsv.gz electiondists.tsv smartvot:$(UPLOAD_DIR)